Re: [boost] Re: Re: Re: partial proposal
Sorry for confusion, the reply below obviously belongs to a different thread. Aleksey Gurtovoy wrote: Andreas Huber wrote: P.S. Is it a good idea to use mpl::aux::msvc_eti_base on all platforms (on conforming compilers I'd expect it to call mpl::identity) or should I #ifdef my way around it? Yep, it's intentionally written in the way so that you don't have to #ifdef in your code. Aleksey ___ Unsubscribe other changes: http://lists.boost.org/mailman/listinfo.cgi/boost ___ Unsubscribe other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Re: [boost] Re: Re: Re: partial proposal
Philippe A. Bouchard [EMAIL PROTECTED] writes: Yes, exactly. Sorry if I wasn't precise enough. The bool type will cancel type_with_alignment effects (at least on Intel compatible platforms); i.e. unique alignment of each optionalT type. Sounds like you want type_with_alignmentT::type storage; new ((void*)storage) T(x, y, z) Can you really do anything to make this cleaner? I guess: aligned_storageT storage; new (storage.bytes) T(x, y, z); might be a help. What else are you gaining? And how do you destroy the T? If not explicitly and you don't have a constructed flag, you're going to have exception-safety problems. -- Dave Abrahams Boost Consulting www.boost-consulting.com ___ Unsubscribe other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Re: [boost] Re: Re: Re: partial proposal
Philippe A. Bouchard [EMAIL PROTECTED] writes: David Abrahams wrote: [...] Example: optionalint i; new (i) int(17); Which copy ctor are you referring to? And why do we want to prevent copy ctor usages? Because optional will be able to handle types without copy constructors (this was the main purpose of partial in fact). I was referring to the copy constructor of optional's template parameter. I understand now, thanks. -- Dave Abrahams Boost Consulting www.boost-consulting.com ___ Unsubscribe other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Re: [boost] Re: Re: Re: partial proposal
Fernando Cacciola \(Home\) [EMAIL PROTECTED] writes: optionalWindow opt( in_placeWindow(point(0,0),point(10,10))); here, in_place() is used to forward T's ctor argument to optional so that T is effectively constructed in-place right within the aligned storage. Is this what you want? I have to say that I like the idea of using placement-new with an optional argument better, since it doesn't get you involved with the const ref/non-const ref/rvalue forwarding problem. -- Dave Abrahams Boost Consulting www.boost-consulting.com ___ Unsubscribe other changes: http://lists.boost.org/mailman/listinfo.cgi/boost