We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
提供一个更加高效的,不抛异常的公有成员函数(比如Widget::swap)。在你类(或类模板)的同一命名空间下提供非成员函数swap,调用你的成员函数。如果你写的是类而不是类模板,请偏特化std::swap,同样应当调用你的成员函数。调用...
Widget::swap
swap
std::swap
https://harttle.land/2015/08/23/effective-cpp-25.html
The text was updated successfully, but these errors were encountered:
感谢博主的总结与分享!! 有个地方似乎有个小瑕疵:
“如果你写的是类而不是类模板,请偏特化std::swap,同样应当调用你的成员函数。”
前面提到了函数模板不能够偏特化,但是这里使用了‘偏特化’,是否应该修改成‘特化’呢?
Sorry, something went wrong.
fix: effective-cpp-25, see #155 thanks @aceyan
864b01e
No branches or pull requests
Effective C++ 25:考虑实现一个不抛异常的swap | Harttle Land
提供一个更加高效的,不抛异常的公有成员函数(比如
Widget::swap
)。在你类(或类模板)的同一命名空间下提供非成员函数swap
,调用你的成员函数。如果你写的是类而不是类模板,请偏特化std::swap
,同样应当调用你的成员函数。调用...https://harttle.land/2015/08/23/effective-cpp-25.html
The text was updated successfully, but these errors were encountered: