Boost logo

Boost Users :

Subject: Re: [Boost-users] [Proto] Storing an Expression Template as a Data Member
From: Hossein Haeri (powerprogman_at_[hidden])
Date: 2011-01-08 13:55:15


> > 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. :)


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net