JUCE
|
The ParameterType struct is used to find the best type to use when passing some kind of object as a parameter. More...
Public Types | |
typedef const Type & | type |
The ParameterType struct is used to find the best type to use when passing some kind of object as a parameter.
Of course, this is only likely to be useful in certain esoteric template situations.
Because "typename TypeHelpers::ParameterType<SomeClass>::type" is a bit of a mouthful, there's a PARAMETER_TYPE(SomeClass) macro that you can use to get the same effect.
E.g. "myFunction (PARAMETER_TYPE (int), PARAMETER_TYPE (MyObject))" would evaluate to "myfunction (int, const MyObject&)", keeping any primitive types as pass-by-value, but passing objects as a const reference, to avoid copying.
typedef const Type& TypeHelpers::ParameterType< Type >::type |