tuple.hpp 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. // (C) Copyright John Maddock 2010.
  2. // Use, modification and distribution are subject to the
  3. // Boost Software License, Version 1.0. (See accompanying file
  4. // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  5. #ifndef BOOST_MATH_TUPLE_HPP_INCLUDED
  6. # define BOOST_MATH_TUPLE_HPP_INCLUDED
  7. # include <boost/config.hpp>
  8. #include <boost/tr1/detail/config.hpp> // for BOOST_HAS_TR1_TUPLE
  9. #ifndef BOOST_NO_CXX11_HDR_TUPLE
  10. #include <tuple>
  11. namespace boost{ namespace math{
  12. using ::std::tuple;
  13. // [6.1.3.2] Tuple creation functions
  14. using ::std::ignore;
  15. using ::std::make_tuple;
  16. using ::std::tie;
  17. using ::std::get;
  18. // [6.1.3.3] Tuple helper classes
  19. using ::std::tuple_size;
  20. using ::std::tuple_element;
  21. }}
  22. #elif defined(BOOST_HAS_TR1_TUPLE)
  23. #include <boost/tr1/tuple.hpp>
  24. namespace boost{ namespace math{
  25. using ::std::tr1::tuple;
  26. // [6.1.3.2] Tuple creation functions
  27. using ::std::tr1::ignore;
  28. using ::std::tr1::make_tuple;
  29. using ::std::tr1::tie;
  30. using ::std::tr1::get;
  31. // [6.1.3.3] Tuple helper classes
  32. using ::std::tr1::tuple_size;
  33. using ::std::tr1::tuple_element;
  34. }}
  35. #elif (defined(__BORLANDC__) && (__BORLANDC__ <= 0x600)) || defined(__IBMCPP__)
  36. #include <boost/tuple/tuple.hpp>
  37. #include <boost/tuple/tuple_comparison.hpp>
  38. #include <boost/type_traits/integral_constant.hpp>
  39. namespace boost{ namespace math{
  40. using ::boost::tuple;
  41. // [6.1.3.2] Tuple creation functions
  42. using ::boost::tuples::ignore;
  43. using ::boost::make_tuple;
  44. using ::boost::tie;
  45. // [6.1.3.3] Tuple helper classes
  46. template <class T>
  47. struct tuple_size
  48. : public ::boost::integral_constant
  49. < ::std::size_t, ::boost::tuples::length<T>::value>
  50. {};
  51. template < int I, class T>
  52. struct tuple_element
  53. {
  54. typedef typename boost::tuples::element<I,T>::type type;
  55. };
  56. #if !BOOST_WORKAROUND(__BORLANDC__, < 0x0582)
  57. // [6.1.3.4] Element access
  58. using ::boost::get;
  59. #endif
  60. } } // namespaces
  61. #else
  62. #include <boost/fusion/include/tuple.hpp>
  63. #include <boost/fusion/include/std_pair.hpp>
  64. namespace boost{ namespace math{
  65. using ::boost::fusion::tuple;
  66. // [6.1.3.2] Tuple creation functions
  67. using ::boost::fusion::ignore;
  68. using ::boost::fusion::make_tuple;
  69. using ::boost::fusion::tie;
  70. using ::boost::fusion::get;
  71. // [6.1.3.3] Tuple helper classes
  72. using ::boost::fusion::tuple_size;
  73. using ::boost::fusion::tuple_element;
  74. }}
  75. #endif
  76. #endif