[Bug libstdc++/24805] New: No non-member swap for shared_ptr

john at johnmaddock dot co dot uk gcc-bugzilla@gcc.gnu.org
Fri Nov 11 17:22:00 GMT 2005


Title say it all really, there appears to be no non-member swap for shared_ptr.

TR.2.2.1 has:

// [2.2.3.8] shared_ptr specialized algorithms
template<class T> void swap(shared_ptr<T>& a, shared_ptr<T>& b);

But code like:

#include <tr1/memory>

using std::tr1::swap;

doesn't compile:

/home/john/boost/libs/tr1/test/test_shared_ptr.cpp: In function `int main()':
/home/john/boost/libs/tr1/test/test_shared_ptr.cpp:94: error: `swap' is not a
member of `std::tr1'
/home/john/boost/libs/tr1/test/test_shared_ptr.cpp:95: error: `swap' was not
declared in this scope

Regards, John Maddock.


-- 
           Summary: No non-member swap for shared_ptr
           Product: gcc
           Version: 4.0.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: john at johnmaddock dot co dot uk
 GCC build triplet: linux.x86
  GCC host triplet: linux.x86
GCC target triplet: linux.x86


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24805



More information about the Gcc-bugs mailing list