I seem to remember I way to select value-pass or reference-pass of a parameter using the size of the type.
Something like:
void fun( check<A> a ){
...
}
Generates or:
void fun( A a ){
...
}
or
void fun( A & a ){
...
}
Depending of the size of type A and the architecture where you compile the applicacion.
In C++11 you can use
std::conditional:For C++03 compilers you could use Boost implementation – Boost.TypeTraits library.
As @sehe mentioned there is also Boost.CallTraits library that correctly implements required functionality: