(1) - error, because reference a can be initialized only in the initialization list.
(2) - an error because the reference
a refers to the local variable
b passed to the constructor as an argument. When exiting the constructor, the
b variable will be destroyed and the value a becomes
(3) - no error. Here the reference
a is equivalent to
(4) - error.
incomplete type while defining
Login in to like
Login in to comment