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).
8 [section:is_stateless is_stateless]
10 struct is_stateless : public __tof {};
12 __inherit If T is a stateless type then inherits from __true_type, otherwise
15 Type T must be a complete type.
17 A stateless type is a type that has no storage and whose constructors and
18 destructors are trivial. That means that `is_stateless` only inherits from
19 __true_type if the following expression is `true`:
21 ::boost::has_trivial_constructor<T>::value
22 && ::boost::has_trivial_copy<T>::value
23 && ::boost::has_trivial_destructor<T>::value
24 && ::boost::is_class<T>::value
25 && ::boost::is_empty<T>::value
29 __header ` #include <boost/type_traits/is_stateless.hpp>` or ` #include <boost/type_traits.hpp>`
31 __compat Without some (as yet unspecified) help from the compiler, is_stateless will never
32 report that a class or struct is stateless; this is always safe,
33 if possibly sub-optimal.
34 Currently (June 2015) compilers more recent than Visual C++ 8, Clang, GCC-4.3, Greenhills 6.0,
35 Intel-11.0, and Codegear have the necessary compiler __intrinsics to ensure that this