Boost logo

Boost :

From: Andy Little (andy_at_[hidden])
Date: 2006-03-31 12:13:16


"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.

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.

regards
Andy Little


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk