Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class A {
- };
- class B : public A {
- };
- class C {
- };
- template <typename T> class base_test {
- static_assert(std::is_base_of<A, T>::value, "Template argument must be derived from A");
- };
- int main() {
- base_test<B> bt1;
- base_test<C> bt2; // Error
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement