From 862dc0001fb6baa0dad292986a7b6369b1fc3564 Mon Sep 17 00:00:00 2001
From: Peter Dimov
operator implementation-defined-type () const; // never throws+
+Returns: an implementation defined value that, when used in boolean + contexts, is equivalent to
+get() != 0
.Throws: nothing.
+Notes: This conversion operator allows shared_ptr objects to be + used in boolean contexts, like
+if (p && p->valid()) {}
. The + actual target type is typically a pointer to a member function, avloiding many + of the implicit conversion pitfalls.
void swap(shared_ptr & b); // never throws
@@ -284,7 +297,7 @@ q = p;template<typename T> bool operator<(shared_ptr<T> const & a, shared_ptr<T> const & b); // never throws-Returns: An implementation-defined value such that
operator<
+Returns: an implementation-defined value such that
operator<
is a strict weak ordering as described in section 25.3[lib.alg.sorting]
of the C++ standard.Throws: nothing.
@@ -347,7 +360,8 @@ q = p;Returns: A shared_ptr<T> object that stores a copy of
-polymorphic_cast<T*>(r.get())
and shares ownership with r.Throws: std::bad_cast when the pointer cannot be converted.
+Throws: std::bad_cast when the pointer cannot be + converted.
Exception safety: If an exception is thrown, the function has no effect.
shared_polymorphic_downcast