Victor Bazarov wrote:
Marcin Kalicinski wrote:
Is it well formed C++ to define free swap function for my custom
container in std namespace?
Yes. You are allowed to _specialise_ any of 'std' templates for your
particular types.
V
So, the first of the following two functions is OK, but not the second,
since the second is an overload and not a specialization?
class MyClass;
namespace std {
template<>
void swap<MyClass>(MyClass&, MyClass&);
}
namespace std {
void swap(MyClass&, MyClass&);
}