"Peter Dimov" <[EMAIL PROTECTED]> writes: > From: "Fernando Cacciola" <[EMAIL PROTECTED]> >> > Yes, I thought about that, too. But if the current swap semantics are >> > retained, it should simply be removed. Otherwise optional<T>::swap must >> > offer at least swap(T&, T&)'s guarantee. >> > >> I'm not sure I follow. >> What are swap(T&, T&) guarantees in general? >> I thought this depended on the specific type. > > True, swap()'s guarantees depend on the type. If T provides a > nothrow/strong/basic swap, optional<T>::swap should be at least > nothrow/strong/basic, respectively. I think that this can be done provided > that T(T const &) is strong and T::~T is nothrow.
I'm confused by this. A constructor pretty much always gives the strong guarantee if it gives the basic guarantee. I suppose it could have side-effects... >> Anyway, as I posted recently, I'm just about to conclude that relational >> operators >> could be properly defined as a synonim for: get_pointer(o1) .relop. >> get_pointer(o2). >> I found this definition totally consistent with pointer semantics and the >> implied >> aliasings. > > Optional does not have pointer semantics. Two optionals can never alias each > other. "Consistent with pointer semantics" doesn't make sense. Optional is > not a pointer. Don't try to make it into one; you'll arrive at shared_ptr. > ;-) As usual, I agree with Peter -- David Abrahams [EMAIL PROTECTED] * http://www.boost-consulting.com Boost support, enhancements, training, and commercial distribution _______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost