linux编译警告 will be initialized after
Posted jiu__
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了linux编译警告 will be initialized after相关的知识,希望对你有一定的参考价值。
这个warning是由于初始化顺序引起的,
- // 会出现warning 的代码!
- class cInit
- {
- public:
- cInit(std::string str, int a) : str_(str), a_(a)
- { }
- private:
- int a_;
- std::string str_;
- };
- // OK
- class cInit
- {
- public:
- cInit(std::string str, int a) : str_(str), a_(a)
- { }
- private:
- std::string str_;
- int a_;
- };
以上是关于linux编译警告 will be initialized after的主要内容,如果未能解决你的问题,请参考以下文章