I don't think this is possible in C ++, what parameters do I need to simulate behavior?
You can use std::is_base_of<YourInterface, YourParameter> and make a mistake if the result is false . Remember this is C ++ 11.
std::is_base_of<YourInterface, YourParameter>
false
Use std::is_base_of as:
std::is_base_of
template<typename T> class A { static_assert(std::is_base_of<IMyInterface, T>::value, "T must derive from IMyInterface"); };
You can also use a function template.
Some polymorphic interfaces or some static interface? The latter can be checked using the "Concept of increasing . "