struct X { X() { std::cout << \"X()\\n\"; } X(int) { std::cout << \"X(int)\\n\"; } }; const int answer = 42; int main() { X(answer);
If you want to declare a variable of the type X, you should do it this way:
X y(answer);