I was doing some c++ practicing this afternoon, and was trying to learn and adopt the copy-swap idiom following this thoroughfully explanation on this question: the Copy-Swap Idiom.
But I found some code I had never seen:
using std::swap; // allow ADL
void swap(dumb_array& pOther) // nothrow
using std::swap; // allow ADL /* <===== THE LINE I DONT UNDERSTAND */
swap(mSize, pOther.mSize); // with the internal members swapped,
swap(mArray, pOther.mArray); // *this and pOther are effectively swapped
using keyword has scoped effect.
This means that
std::swap can be referred to as
swap during the scope of the