I need a function with this interface.
func<Type1,CompileOption>( Type2 value)
func<Type1>( Type2 value)
The first compile time parameter is a type. This is required every time the function is called.
The second compile time parameter is optional. It is used to change behavior func.
The function itself is tuned to the regular type of the parameter ( Type2).
Is it possible to create such an interface?
If he canβt find a way to do this? for example, something that acts as a template function that takes two compile-time parameters, where the second is optional?
The naive approach does not work.
template< typename Type1, typename CompileOption = Default, typename Type2>
void func( Type2 t2 );
template< typename Type1, typename Type2, typename CompileOption = Default>
void func( Type2 t2 );
template<typename Type2>
template<typename Type1, typename Optional = Default >
void func( Type2 t2 );
source
share