mpl.hpp 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. //////////////////////////////////////////////////////////////////////////////
  2. //
  3. // (C) Copyright Ion Gaztanaga 2005-2013.
  4. //
  5. // Distributed under the Boost Software License, Version 1.0.
  6. // (See accompanying file LICENSE_1_0.txt or copy at
  7. // http://www.boost.org/LICENSE_1_0.txt)
  8. //
  9. // See http://www.boost.org/libs/container for documentation.
  10. //
  11. //////////////////////////////////////////////////////////////////////////////
  12. #ifndef BOOST_CONTAINER_CONTAINER_DETAIL_MPL_HPP
  13. #define BOOST_CONTAINER_CONTAINER_DETAIL_MPL_HPP
  14. #ifndef BOOST_CONFIG_HPP
  15. # include <boost/config.hpp>
  16. #endif
  17. #if defined(BOOST_HAS_PRAGMA_ONCE)
  18. # pragma once
  19. #endif
  20. #include <boost/container/detail/config_begin.hpp>
  21. #include <boost/container/detail/workaround.hpp>
  22. #include <boost/move/detail/type_traits.hpp>
  23. #include <boost/intrusive/detail/mpl.hpp>
  24. #include <cstddef>
  25. namespace boost {
  26. namespace container {
  27. namespace dtl {
  28. using boost::move_detail::integral_constant;
  29. using boost::move_detail::true_type;
  30. using boost::move_detail::false_type;
  31. using boost::move_detail::enable_if_c;
  32. using boost::move_detail::enable_if;
  33. using boost::move_detail::enable_if_convertible;
  34. using boost::move_detail::disable_if_c;
  35. using boost::move_detail::disable_if;
  36. using boost::move_detail::disable_if_convertible;
  37. using boost::move_detail::is_convertible;
  38. using boost::move_detail::if_c;
  39. using boost::move_detail::if_;
  40. using boost::move_detail::identity;
  41. using boost::move_detail::bool_;
  42. using boost::move_detail::true_;
  43. using boost::move_detail::false_;
  44. using boost::move_detail::yes_type;
  45. using boost::move_detail::no_type;
  46. using boost::move_detail::bool_;
  47. using boost::move_detail::true_;
  48. using boost::move_detail::false_;
  49. using boost::move_detail::unvoid_ref;
  50. using boost::move_detail::and_;
  51. using boost::move_detail::or_;
  52. using boost::move_detail::not_;
  53. using boost::move_detail::enable_if_and;
  54. using boost::move_detail::disable_if_and;
  55. using boost::move_detail::enable_if_or;
  56. using boost::move_detail::disable_if_or;
  57. template <class FirstType>
  58. struct select1st
  59. {
  60. typedef FirstType type;
  61. template<class T>
  62. const type& operator()(const T& x) const
  63. { return x.first; }
  64. template<class T>
  65. type& operator()(T& x)
  66. { return const_cast<type&>(x.first); }
  67. };
  68. template <class T, class=void>
  69. struct is_transparent
  70. {
  71. static const bool value = false;
  72. };
  73. template <class T>
  74. struct is_transparent<T, typename T::is_transparent>
  75. {
  76. static const bool value = true;
  77. };
  78. template <typename C, typename K, typename R>
  79. struct enable_if_transparent
  80. : boost::move_detail::enable_if_c<dtl::is_transparent<C>::value, R>
  81. {};
  82. } //namespace dtl {
  83. } //namespace container {
  84. } //namespace boost {
  85. #include <boost/container/detail/config_end.hpp>
  86. #endif //#ifndef BOOST_CONTAINER_CONTAINER_DETAIL_MPL_HPP