Pointer Member Variable Initialization in C++ Classes

后端 未结 4 1991
梦谈多话
梦谈多话 2020-12-17 09:34

This is going to sound so basic as to make one think I made zero effort to find the answer myself, but I swear I did search for about 20 minutes and found no answer.

4条回答
  •  失恋的感觉
    2020-12-17 10:18

    Value will be undefined.

    You may have one "ultimate" ctor which will initialize all fields and add "short-cut" ctors with only part of parameters, which will pass these params to ultimate ctor along with default values for the rest of params.

提交回复
热议问题