struct A{
A(){}
};
struct B{
B(const A& a){}
};
int main()
{
//Originally I would like to write down below code
A a;
B b(a);
//Unfortunately I end up with below code by accident and there is no compile error
//I have figured out the below does not create temporary A and call B constructor to
//create B as the above codes,
//it declares a function with return value B, name b,
//and some input parameter, my question is 1) what the input parameter is ?
//2) How to implement such a function.
B b(A()); // There is no global function A() in my test case.
}
The question is in the comment, I hope some people can help me to understand it. Thank you very much.