文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>Item 25: Consider support for a non-throwing swap(Effective C++)

Item 25: Consider support for a non-throwing swap(Effective C++)

时间:2011-03-28  来源:Ray Z

  • Provide a swap member function when std::swap would be inefficient for your type. Make sure your swap doesn't throw exceptions.

  • If you offer a member swap, also offer a non-member swap that calls the member. For classes (not templates), specialize std::swap, too.

  • When calling swap, employ a using declaration for std::swap, then call swap without namespace qualification.

  • It's fine to totally specialize std templates for user-defined types, but never try to add something completely new to std.

相关阅读 更多 +
排行榜 更多 +
鸡生化精英安卓版

鸡生化精英安卓版

飞行射击 下载
光头火柴人安卓版

光头火柴人安卓版

飞行射击 下载
轨道射击安卓版

轨道射击安卓版

飞行射击 下载