https://isocpp.org/wiki/faq/ctors#overview-ctors
- What’s the deal with constructors?
- Is there any difference between
List x;
andList x();
? - Can one constructor of a class call another constructor of the same class to initialize the
this
object? - Is the default constructor for
Fred
alwaysFred::Fred()
? - Which constructor gets called when I create an array of
Fred
objects? - Should my constructors use “initialization lists” or “assignment”?
- How should initializers be ordered in a constructor’s initialization list?
- Is it moral for one member object to be initialized using another member object in the initializer expression?
- What if one member object has to be initialized using another member object?
- Should you use the
this
pointer in the constructor? - What is the “Named Constructor Idiom”?
- Does return-by-value mean extra copies and extra overhead?
- What about returning a local variable by value? Does the local exist as a separate object, or does it get optimized away?
- Why can’t I initialize my
static
member data in my constructor’s initialization list? - Why are classes with
static
data members getting linker errors? - Can I add
=
initializer;
to the declaration of a class-scopestatic
const
data member? - What’s the “
static
initialization order ‘fiasco’ (problem)”? - How do I prevent the “
static
initialization order problem”? - Why doesn’t the Construct On First Use Idiom use a
static
object instead of astatic
pointer? - What is a technique to guarantee both
static
initialization andstatic
deinitialization? - How do I prevent the “
static
initialization order problem” for mystatic
data members? - Do I need to worry about the “
static
initialization order problem” for variables of built-in/intrinsic types? - How can I handle a constructor that fails?
- What is the “Named Parameter Idiom”?
- Why am I getting an error after declaring a
Foo
object viaFoo x(Bar())
? - What is the purpose of the
explicit
keyword? - Why doesn’t my constructor work right?