// Compiles without errors, meaning that all the static_asserts hold. #include #include #include class D {}; class E{ public: virtual void vf(){}; }; int main(){ int a; int &b = a; int *c = &a; D d; E *ep; std::remove_pointer::type f; // Corresponds to E f; f.vf(); // OK, because the type of f is E. static_assert(std::is_integral::value, "type of a is expected to be integral"); static_assert(std::is_fundamental::value, "type of a is expected to be a fundamental type"); static_assert(std::is_reference::value, "type of b is expected to be a reference"); static_assert(std::is_lvalue_reference::value, "type of b is expected to be a lvalue reference"); static_assert(!std::is_rvalue_reference::value, "type of b is NOT expected to be a rvalue reference"); static_assert(std::is_pointer::value, "type of c is expected to be a pointer"); static_assert(std::is_class::value, "type of d is expected to be a class"); static_assert(std::is_polymorphic::value, "E is expected to be polymorphic - it has a virtual function"); static_assert(std::is_polymorphic::type>::value, "ep (without ptr) is expected to be polymorphic"); }