is_polymorphic.qbk 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. [/
  2. Copyright 2007 John Maddock.
  3. Distributed under the Boost Software License, Version 1.0.
  4. (See accompanying file LICENSE_1_0.txt or copy at
  5. http://www.boost.org/LICENSE_1_0.txt).
  6. ]
  7. [section:is_polymorphic is_polymorphic]
  8. template <class T>
  9. struct is_polymorphic : public __tof {};
  10. __inherit If T is a (possibly cv-qualified) polymorphic type
  11. then inherits from __true_type,
  12. otherwise inherits from __false_type. Type `T` must be a complete type.
  13. __std_ref 10.3.
  14. __compat The implementation requires some knowledge of the compilers ABI,
  15. it does actually seem to work with the majority of compilers though.
  16. __header ` #include <boost/type_traits/is_polymorphic.hpp>` or ` #include <boost/type_traits.hpp>`
  17. __examples
  18. [: Given: `class poly{ virtual ~poly(); };` ]
  19. [:`is_polymorphic<poly>` inherits from `__true_type`.]
  20. [:`is_polymorphic<poly const>::type` is the type `__true_type`.]
  21. [:`is_polymorphic<poly>::value` is an integral constant
  22. expression that evaluates to /true/.]
  23. [:`is_polymorphic<T>::value_type` is the type `bool`.]
  24. [endsect]