what does `using std::swap` inside the body of a class method implementation mean?

前端 未结 2 1019
清酒与你
清酒与你 2020-12-09 15:30

I was trying to learn and adopt the copy-swap idiom following this thorough explanation on this question: the Copy-Swap Idiom.

But I found some code I had never seen

2条回答
  •  孤街浪徒
    2020-12-09 15:45

    The using keyword has scoped effect.

    This means that std::swap can be referred to as swap during the scope of the using keyword.

提交回复
热议问题