tuple.hpp 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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. #ifndef BOOST_NO_CXX11_HDR_TUPLE
  9. #include <tuple>
  10. namespace boost{ namespace math{
  11. using ::std::tuple;
  12. // [6.1.3.2] Tuple creation functions
  13. using ::std::ignore;
  14. using ::std::make_tuple;
  15. using ::std::tie;
  16. using ::std::get;
  17. // [6.1.3.3] Tuple helper classes
  18. using ::std::tuple_size;
  19. using ::std::tuple_element;
  20. }}
  21. #elif (defined(__BORLANDC__) && (__BORLANDC__ <= 0x600)) || defined(__IBMCPP__)
  22. #include <boost/tuple/tuple.hpp>
  23. #include <boost/tuple/tuple_comparison.hpp>
  24. #include <boost/type_traits/integral_constant.hpp>
  25. namespace boost{ namespace math{
  26. using ::boost::tuple;
  27. // [6.1.3.2] Tuple creation functions
  28. using ::boost::tuples::ignore;
  29. using ::boost::make_tuple;
  30. using ::boost::tie;
  31. // [6.1.3.3] Tuple helper classes
  32. template <class T>
  33. struct tuple_size
  34. : public ::boost::integral_constant
  35. < ::std::size_t, ::boost::tuples::length<T>::value>
  36. {};
  37. template < int I, class T>
  38. struct tuple_element
  39. {
  40. typedef typename boost::tuples::element<I,T>::type type;
  41. };
  42. #if !BOOST_WORKAROUND(__BORLANDC__, < 0x0582)
  43. // [6.1.3.4] Element access
  44. using ::boost::get;
  45. #endif
  46. } } // namespaces
  47. #else
  48. #include <boost/fusion/include/tuple.hpp>
  49. #include <boost/fusion/include/std_pair.hpp>
  50. namespace boost{ namespace math{
  51. using ::boost::fusion::tuple;
  52. // [6.1.3.2] Tuple creation functions
  53. using ::boost::fusion::ignore;
  54. using ::boost::fusion::make_tuple;
  55. using ::boost::fusion::tie;
  56. using ::boost::fusion::get;
  57. // [6.1.3.3] Tuple helper classes
  58. using ::boost::fusion::tuple_size;
  59. using ::boost::fusion::tuple_element;
  60. }}
  61. #endif
  62. #endif