With a healthy dose of fear for reinventing the wheel - im looking for a generic template for a proxy like object that will help me customize the constructor - a very basic and unfinished sketch look like this:
template<class T>
struct proxy {
proxy( ? ) {<customized init of elem_ - possible two-phase calling init(), etc. >}
T& operator*() {return elem_;}
private:
T elem_;
};
Normally you would implement different access mechanics, etc., etc. which becomes easy to get wrong / or just not very future-proof.
In this case i just need to customize the construction of the object (which can't be copied and is the reason why in this case, such a proxy would be helpfull). Though often for proxy pattern it is the access that is customized. In a pinch, a "lazy construction template" would also solve it.