different types of initialization in C++

前端 未结 2 1633
夕颜
夕颜 2020-12-10 03:02

I\'m learning C++, and am rather confused as to the different types of initialization.

You can do:

T a;

which, as far as I can tell

2条回答
  •  天涯浪人
    2020-12-10 03:23

    T a = 1; // implicitly converted to T sometimes?

    You can do that if T has a copy constructor.

    T a();

    this sound more like a function declaration of "a" that return a type T

提交回复
热议问题