Given your sample code, you get an error saying that you cannot pass a non-POD object to ellipses. This is because you are trying to pass a non-POD type to a variable function that takes a variable number of arguments. In this case, calling printf , which is declared something like below
int printf ( const char * format, ... );
The ellipsis used as the last parameter allows you to pass 0 or more additional arguments to the functions that you execute in your code. C ++ standard allows you to pass a non-POD type, but compilers do not support to support him. This is partially addressed in 5.2.2 / 7 of the standard.
Passing a potentially evaluated argument to a class type that has a nontrivial copy constructor, a nontrivial move constructor, or a nontrivial destructor without the corresponding parameter is conditionally supported with semantics defined by the implementation.
This means that every compiler manufacturer must decide if he wants to support it and how it will behave. Obviously, your compiler does not support this, and even if that were the case, I would not recommend using it.
source share