/Src/Dependencies/Boost/boost/variant/detail/has_trivial_move.hpp

http://hadesmem.googlecode.com/ · C++ Header · 100 lines · 68 code · 22 blank · 10 comment · 0 complexity · 7da66d2b70641c4e3b8d357a3525714b MD5 · raw file

  1. // (C) Copyright Eric Friedman 2002-2003.
  2. // Distributed under the Boost Software License, Version 1.0. (See
  3. // 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 for most recent version including documentation.
  7. #ifndef BOOST_VARIANT_DETAIL_HAS_TRIVIAL_MOVE_HPP_INCLUDED
  8. #define BOOST_VARIANT_DETAIL_HAS_TRIVIAL_MOVE_HPP_INCLUDED
  9. #include "boost/config.hpp" // for STATIC_CONSTANT
  10. #include "boost/type_traits/has_trivial_copy.hpp"
  11. #include "boost/type_traits/has_trivial_assign.hpp"
  12. #include "boost/mpl/and.hpp"
  13. #include "boost/mpl/or.hpp"
  14. // should be the last #include
  15. #include "boost/variant/detail/bool_trait_def.hpp"
  16. namespace boost {
  17. namespace detail { namespace variant {
  18. // TRAIT: has_trivial_move
  19. template <typename T>
  20. struct has_trivial_move_impl
  21. {
  22. BOOST_STATIC_CONSTANT(
  23. bool, value = (
  24. ::boost::mpl::and_<
  25. has_trivial_copy<T>
  26. , has_trivial_assign<T>
  27. >::type::value
  28. )
  29. );
  30. };
  31. BOOST_VARIANT_TT_AUX_BOOL_TRAIT_DEF1(
  32. has_trivial_move
  33. , T
  34. , (::boost::detail::variant::has_trivial_move_impl<T>::value)
  35. )
  36. // TRAIT: has_trivial_move_constructor
  37. template <typename T>
  38. struct has_trivial_move_constructor_impl
  39. {
  40. BOOST_STATIC_CONSTANT(
  41. bool, value = (
  42. ::boost::mpl::or_<
  43. has_trivial_move<T>
  44. , has_trivial_copy<T>
  45. >::type::value
  46. )
  47. );
  48. };
  49. BOOST_VARIANT_TT_AUX_BOOL_TRAIT_DEF1(
  50. has_trivial_move_constructor
  51. , T
  52. , (::boost::detail::variant::has_trivial_move_constructor_impl<T>::value)
  53. )
  54. // TRAIT: has_trivial_move_assign
  55. template <typename T>
  56. struct has_trivial_move_assign_impl
  57. {
  58. BOOST_STATIC_CONSTANT(
  59. bool, value = (
  60. ::boost::mpl::or_<
  61. has_trivial_move<T>
  62. , has_trivial_assign<T>
  63. >::type::value
  64. )
  65. );
  66. };
  67. BOOST_VARIANT_TT_AUX_BOOL_TRAIT_DEF1(
  68. has_trivial_move_assign
  69. , T
  70. , (::boost::detail::variant::has_trivial_move_assign_impl<T>::value)
  71. )
  72. }} // namespace detail::variant
  73. BOOST_VARIANT_TT_AUX_TRAIT_SUFFIX(1,::boost::detail::variant::has_trivial_move)
  74. BOOST_VARIANT_TT_AUX_TRAIT_SUFFIX(1,::boost::detail::variant::has_trivial_move_constructor)
  75. BOOST_VARIANT_TT_AUX_TRAIT_SUFFIX(1,::boost::detail::variant::has_trivial_move_assign)
  76. } // namespace boost
  77. #include "boost/variant/detail/bool_trait_undef.hpp"
  78. #endif // BOOST_VARIANT_DETAIL_HAS_TRIVIAL_MOVE_HPP_INCLUDED