]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/type_traits/doc/is_stateless.qbk
add subtree-ish sources for 12.0.3
[ceph.git] / ceph / src / boost / libs / type_traits / doc / is_stateless.qbk
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
8 [section:is_stateless is_stateless]
9 template <class T>
10 struct is_stateless : public __tof {};
11
12 __inherit If T is a stateless type then inherits from __true_type, otherwise
13 from __false_type.
14
15 Type T must be a complete type.
16
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`:
20
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
26
27 __std_ref 3.9p10.
28
29 __header ` #include <boost/type_traits/is_stateless.hpp>` or ` #include <boost/type_traits.hpp>`
30
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
36 trait "just works".
37
38 [endsect]
39