From: "Dan Gohman" <[EMAIL PROTECTED]> [...] > Documentation: > > set > > void set(T * p); // never throws > > Stores a copy of p, which must have been allocated via a C++ new > expression or be 0. Behavior is undefined if the stored pointer > is not 0.
Rejected, sorry. :-) Introducing undefined behavior for its own sake is never a good design. You can always use BOOST_ASSERT(!p); p.reset(new X); in client code to emulate the behavior of your proposed 'set'. In general, it is recommended practice to always assert() preconditions in client code, instead of relying on in-library asserts. First, the library is not required to have asserts, and second, the earlier you catch precondition violations, the better (call stacks aren't universally available). So "by the book" you'd have written BOOST_ASSERT(!p); p.set(new X); that's not really that different from the above to warrant an interface change. _______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost