c++ - assure correct order of initialization of const members in an initializer list via static_assert -



c++ - assure correct order of initialization of const members in an initializer list via static_assert -

i have c++ class const& members initialized in initialization list of constructor.

the order of initialization of members crucial, rely on order of fellow member declarations in class declaration , corresponding order in initialization list.

compiles fine without errors or warnings.

my question is: can means, static_assert or similar, assure, nobody ever changes order of either declarations or initialization list?

i know, doing trigger compiler warning, there people out there don't care compiler warnings. so, there way turn error message... ?

c++ reference initializer-list static-assert

Comments

Popular posts from this blog

assembly - What is the addressing mode for ld, add, and rjmp instructions? -

vowpalwabbit - Interpreting Vowpal Wabbit results: Why are some lines appended by "h"? -

Is there a way to convert an HTML page styled with Bootstrap CSS into email-compatible html? -