No; mA
is not an object but merely a reference, so there is nothing to construct.
Is the right value's constructor called in initialization?
Question
For example,
struct A {};
struct B
{
B(A&& a)
: mA(std::move(a)) // Is A's constructor called here?
{}
A&& mA;
};
Is A
's constructor called in the initialization list of B
? Or it's like a reference implemented by a pointer?
Solution
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow