Should you overload swap in the std namespace?

前端 未结 5 1994
闹比i
闹比i 2020-12-06 00:22

I read something interesting today that said the \'standard\' way to call swap on a user provided type (provided as a template argument) is...

using std::swa         


        
5条回答
  •  南方客
    南方客 (楼主)
    2020-12-06 00:53

    I believe this is the answer you're looking for, and the entire set of answers to that question explain all. Howard Hinnant and Dave Abrahams have been on the C++ standards committee for more than a decade I think.

提交回复
热议问题