tuple.hpp 1.9 KB

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