首页 > 系统服务 > 详细

linux编译警告 will be initialized after

时间:2017-08-08 11:51:20      阅读:263      评论:0      收藏:0      [点我收藏+]
这个warning是由于初始化顺序引起的, 
  1. // 会出现warning 的代码!
  2. class cInit
  3. {
  4. public:
  5.     cInit(std::string str, int a) : str_(str), a_(a)
  6.     { }
  7. private:
  8.     int a_;
  9.     std::string str_;
  10. };

 

  1. // OK
  2. class cInit
  3. {
  4. public:
  5.     cInit(std::string str, int a) : str_(str), a_(a)
  6.     { }
  7. private:
  8.     std::string str_;
  9.     int a_;
  10. };

linux编译警告 will be initialized after

原文:http://www.cnblogs.com/jiu0821/p/7305891.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!