blob: d2de82f4a12cc96dbfe2ddeda208ebbe7fd7e8c8 [file] [log] [blame]
[/
Copyright 2007 John Maddock.
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at
http://www.boost.org/LICENSE_1_0.txt).
]
[section:is_stateless is_stateless]
template <class T>
struct is_stateless : public __tof {};
__inherit If T is a stateless type then inherits from __true_type, otherwise
from __false_type.
Type T must be a complete type.
A stateless type is a type that has no storage and whose constructors and
destructors are trivial. That means that `is_stateless` only inherits from
__true_type if the following expression is `true`:
::boost::has_trivial_constructor<T>::value
&& ::boost::has_trivial_copy<T>::value
&& ::boost::has_trivial_destructor<T>::value
&& ::boost::is_class<T>::value
&& ::boost::is_empty<T>::value
__std_ref 3.9p10.
__header ` #include <boost/type_traits/is_stateless.hpp>` or ` #include <boost/type_traits.hpp>`
__compat If the compiler does not support partial-specialization of class templates,
then this template can not be used with function types.
Without some (as yet unspecified) help from the compiler, is_stateless will never
report that a class or struct is stateless; this is always safe,
if possibly sub-optimal.
Currently (May 2011) compilers more recent than Visual C++ 8, GCC-4.3, Greenhills 6.0,
Intel-11.0, and Codegear have the necessary compiler __intrinsics to ensure that this
trait "just works".
[endsect]