is_stateless.hpp 1.1 KB

123456789101112131415161718192021222324252627282930313233
  1. // (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000.
  2. // Use, modification and distribution are subject to the Boost Software License,
  3. // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
  4. // http://www.boost.org/LICENSE_1_0.txt).
  5. //
  6. // See http://www.boost.org/libs/type_traits for most recent version including documentation.
  7. #ifndef BOOST_TT_IS_STATELESS_HPP_INCLUDED
  8. #define BOOST_TT_IS_STATELESS_HPP_INCLUDED
  9. #include <boost/type_traits/has_trivial_constructor.hpp>
  10. #include <boost/type_traits/has_trivial_copy.hpp>
  11. #include <boost/type_traits/has_trivial_destructor.hpp>
  12. #include <boost/type_traits/is_class.hpp>
  13. #include <boost/type_traits/is_empty.hpp>
  14. #include <boost/config.hpp>
  15. namespace boost {
  16. template <typename T>
  17. struct is_stateless
  18. : public integral_constant<bool,
  19. (::boost::has_trivial_constructor<T>::value
  20. && ::boost::has_trivial_copy<T>::value
  21. && ::boost::has_trivial_destructor<T>::value
  22. && ::boost::is_class<T>::value
  23. && ::boost::is_empty<T>::value)>
  24. {};
  25. } // namespace boost
  26. #endif // BOOST_TT_IS_STATELESS_HPP_INCLUDED