How are the references and const variables in the class before CPP11 initialized?

CPP11 allows list initialization for all objects, and because the constructor body is assigned, references and const variables must be initialized first, so you must use list initialization, so how is it initialized before CPP11?

Mar.04,2021

initialization of members can be done with direct initialization . The specific practice is:

Class::Class() : member(args)... {...}

this does not require cPP11.

Menu