is_pair.hpp 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  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_IS_PAIR_HPP
  13. #define BOOST_CONTAINER_CONTAINER_DETAIL_IS_PAIR_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/container/detail/std_fwd.hpp>
  23. #if defined(BOOST_MSVC) && (_CPPLIB_VER == 520)
  24. //MSVC 2010 tuple marker
  25. namespace std { namespace tr1 { struct _Nil; }}
  26. #elif defined(BOOST_MSVC) && (_CPPLIB_VER == 540)
  27. //MSVC 2012 tuple marker
  28. namespace std { struct _Nil; }
  29. #endif
  30. namespace boost {
  31. namespace tuples {
  32. struct null_type;
  33. template <
  34. class T0, class T1, class T2,
  35. class T3, class T4, class T5,
  36. class T6, class T7, class T8,
  37. class T9>
  38. class tuple;
  39. } //namespace tuples {
  40. } //namespace boost {
  41. namespace boost {
  42. namespace container {
  43. struct try_emplace_t{};
  44. namespace dtl {
  45. template <class T1, class T2>
  46. struct pair;
  47. template <class T>
  48. struct is_pair
  49. {
  50. static const bool value = false;
  51. };
  52. template <class T1, class T2>
  53. struct is_pair< pair<T1, T2> >
  54. {
  55. static const bool value = true;
  56. };
  57. template <class T1, class T2>
  58. struct is_pair< std::pair<T1, T2> >
  59. {
  60. static const bool value = true;
  61. };
  62. template <class T>
  63. struct is_not_pair
  64. {
  65. static const bool value = !is_pair<T>::value;
  66. };
  67. } //namespace dtl {
  68. } //namespace container {
  69. } //namespace boost {
  70. #include <boost/container/detail/config_end.hpp>
  71. #endif //#ifndef BOOST_CONTAINER_CONTAINER_DETAIL_IS_PAIR_HPP