Consider for this question the following code:
#include
namespace ns
{
struct foo
{
foo() : i(0) {}
Well, boost::swap()
dispatches to std::swap()
. To have std::swap()
do something similar to boost::swap()
it would need to delegate somewhere else. What is this somewhere else? The standard doesn't mandate another version of swap()
which provides the actual implementation. This can be done but the standard doesn't mandate it.
Why it doesn't do it? I didn't see any proposal proposing this implementation. If someone had wanted this to do done I'm sure it would have been proposed.