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