How can I enforce that a template parameter used implements some interface in C++?

c++, interface, templates

Solution

You can use `std::is_base_of<YourInterface, YourParameter>`, and make an error if the result is `false`. Remember this is C++11.

Problem

I don't think this is possible in C++, what options do I have to simulate the behavior?

Original source