Re: [boost] [optional] std::tr2::optional

19 Nov
2011
19 Nov
'11
10:27 a.m.
The guarantee is strong if the placement delete/new are marked noexcept, isn't it?
What I meant by "a >>pseudo destructor call<< followed by a call to placement new." is a call to destructor w/o releasing the memory and then a call to constructor w/o allocating memory: ob.~T(); new (&ob) T( std::forward<Args>(args)... ); This trick will provide a strong guarantee if destructor and the constructor are nothrow. While destructors usually are non-throwing, it is rather unlikely that constructors would not throw: it is the constructors that we often expect to throw in case of initialization failure. Regards, &rzej
4972
Age (days ago)
4972
Last active (days ago)
0 comments
1 participants
participants (1)
-
Andrzej Krzemienski