is_complete.qbk 1.1 KB

1234567891011121314151617181920212223242526272829
  1. [/
  2. Copyright 2018 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_complete is_complete]
  8. template <class T>
  9. struct is_complete : public __tof {};
  10. __inherit If `T` is a complete type then inherits from __true_type,
  11. otherwise inherits from __false_type.
  12. [important This trait is designed for one use only: to trigger a hard error (via a `static_assert`) when a template
  13. is accidentally instantiated on an incomplete type. Any other use case will cause ODR violations as the "completeness"
  14. of type `T` may vary at different points in the current translation unit, as well as across translations units.
  15. ['[*In particular this trait should never ever be used to change code paths depending on the completeness of a type]].]
  16. __header ` #include <boost/type_traits/is_complete.hpp>` or ` #include <boost/type_traits.hpp>`
  17. __compat Requires C++11 SFINAE-expressions to function fully. The macro `BOOST_TT_HAS_WORKING_IS_COMPLETE` is defined
  18. when the trait is fully functional.
  19. [endsect]