Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

This is the documentation for an old version of Boost. Click here to view this page for the latest version.
PrevUpHomeNext

is_complete

template <class T>
struct is_complete : public true_type-or-false_type {};

Inherits: If T is a complete type then inherits from true_type, otherwise inherits from false_type.

[Important] Important

This trait is designed for one use only: to trigger a hard error (via a static_assert) when a template is accidentally instantiated on an incomplete type. Any other use case will cause ODR violations as the "completeness" of type T may vary at different points in the current translation unit, as well as across translations units. In particular this trait should never ever be used to change code paths depending on the completeness of a type.

Header: #include <boost/type_traits/is_complete.hpp> or #include <boost/type_traits.hpp>

Compiler Compatibility: Requires C++11 SFINAE-expressions to function fully. The macro BOOST_TT_HAS_WORKING_IS_COMPLETE is defined when the trait is fully functional.


PrevUpHomeNext