I am using msvc 2013. I have following code:
#include <iostream>
struct A
{
A(void)
{
std::cout << "A()" << std::endl;
}
A(const A& a)
{
std::cout << "A(const A&)" << std::endl;
}
A(A&& a)
{
std::cout << "A(A&&)" << std::endl;
}
static void foo(const A& a)
{
std::cout << "Foo" << std::endl;
}
};
int main(void)
{
A::foo(A(A()));
int i = 0;
std::cin >> i;
}
When I run program, copy and move constructors of struct A are ignored. I really don't understand this case. Output is: "A() Foo"