libstdc++ of g++ 3.4.x: std::swap and std::auto_ptr causes compilation errors

Vinzenz Feenstra
Mon Nov 15 22:23:00 GMT 2004


I want to point to something which is imho a Bug.

if I try to swap a std::auto_ptr with std::swap it causes a compilation 
error because


do not correctly recongnizes that std::auto_ptr is really assignable.

In my opinion, either a second std::swap template function like that:

namespace std
 template<class T>
   void swap(std::auto_ptr<T>& lhs, std::auto_ptr<T>& rhs)
      std::auto_ptr<T> tmp = lhs;
      lhs = rhs;
      rhs = tmp;

or __glibcxx_function_requires(_SGIAssignableConcept<_Tp>)

should be removed or modified in that way, that it won't raise an error 
while compiling.


Vinzenz Feenstra

More information about the Libstdc++ mailing list