A a(something) says the construction of a from something . Therefore, if we substitute something into {1.0f, 0.0f} , we need to find a constructor in which the parameter can be initialized using {1.0f, 0.0f} . The only constructors we have are the default copy and move constructors, which take the values const A& and A&& respectively.
So doing
A a({1.0f, 0.0f});
It will actually create a temporary a , and then use that temporary value to initialize a . In this case, he will use the move constructor, since the object is movable, and it is preferable to copy the move constructors when working with r values.
Nathan oliver
source share