
8 Jan
2011
8 Jan
'11
6:55 p.m.
So, what about the following?
#define DEFINE_MY_CLASS(name, exp) \
MyClass<result_of::deep_copy<BOOST_TYPEOF(exp)>::type> name(deep_copy(exp))
Sure. Or you could move the deep-copy action an implementation detail of MyClass and keep the macro simple. Whichever.
Right. Either way, how should I deal with copy construction? Is the deeply copied thing automatic for copy construction? Or, should I make another deep copy each time?
No, I'm not saying that. I'm saying you can use >> and Proto to build an expression tree, and use a transform to compose that tree into a function object. <snip>
I see. Hmmm... I guess the same technique wouldn't be working uniformly for my entire syntax. Thanks for the suggestion though. :)