文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
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.

相关阅读 更多 +
排行榜 更多 +
超级冒险王安卓版

超级冒险王安卓版

休闲益智 下载
玩具小镇手机版

玩具小镇手机版

休闲益智 下载
这一关特上头手机版

这一关特上头手机版

休闲益智 下载