
Andy Little wrote:
"Tobias Schwinger" wrote
// IS_TYPE((int))::value is true // IS_TYPE((1))::value is false
Does anyone know how to implement this without a typeof operator?
I havent got a solution but one avenue thats seems to be in the right field is to exploit the difference between a function call and a declaration:
Sometype func_or_value( Entity_to_test);
eg assume Entity_to_test is a type then func_or_value is a function, else func_or_value is a variable.
Yeah, this route occured to me. Unfortunately it requires namespace or class scope to work, while the typeof version can be encoded in a single expression.
Dont know if it helps though. The other slim hope is exploiting how e.g std::for_each uses its last argument, but I dont quite know how that would help if at all.
I'm not sure I know what you mean. Would you elaborate? Regards, Tobias