• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 
6 #ifndef BOOST_MATH_TUPLE_HPP_INCLUDED
7 #  define BOOST_MATH_TUPLE_HPP_INCLUDED
8 #  include <boost/config.hpp>
9 #  include <boost/detail/workaround.hpp>
10 #  include <boost/math/tools/cxx03_warn.hpp>
11 
12 #if !defined(BOOST_NO_CXX11_HDR_TUPLE) && !BOOST_WORKAROUND(BOOST_GCC_VERSION, < 40500)
13 
14 #include <tuple>
15 
16 namespace boost{ namespace math{
17 
18 using ::std::tuple;
19 
20 // [6.1.3.2] Tuple creation functions
21 using ::std::ignore;
22 using ::std::make_tuple;
23 using ::std::tie;
24 using ::std::get;
25 
26 // [6.1.3.3] Tuple helper classes
27 using ::std::tuple_size;
28 using ::std::tuple_element;
29 
30 }}
31 
32 #elif (defined(__BORLANDC__) && (__BORLANDC__ <= 0x600)) || defined(__IBMCPP__)
33 
34 #include <boost/tuple/tuple.hpp>
35 #include <boost/tuple/tuple_comparison.hpp>
36 #include <boost/type_traits/integral_constant.hpp>
37 
38 namespace boost{ namespace math{
39 
40 using ::boost::tuple;
41 
42 // [6.1.3.2] Tuple creation functions
43 using ::boost::tuples::ignore;
44 using ::boost::make_tuple;
45 using ::boost::tie;
46 
47 // [6.1.3.3] Tuple helper classes
48 template <class T>
49 struct tuple_size
50    : public ::boost::integral_constant
51    < ::std::size_t, ::boost::tuples::length<T>::value>
52 {};
53 
54 template < int I, class T>
55 struct tuple_element
56 {
57    typedef typename boost::tuples::element<I,T>::type type;
58 };
59 
60 #if !BOOST_WORKAROUND(__BORLANDC__, < 0x0582)
61 // [6.1.3.4] Element access
62 using ::boost::get;
63 #endif
64 
65 } } // namespaces
66 
67 #else
68 
69 #include <boost/fusion/include/tuple.hpp>
70 #include <boost/fusion/include/std_pair.hpp>
71 
72 namespace boost{ namespace math{
73 
74 using ::boost::fusion::tuple;
75 
76 // [6.1.3.2] Tuple creation functions
77 using ::boost::fusion::ignore;
78 using ::boost::fusion::make_tuple;
79 using ::boost::fusion::tie;
80 using ::boost::fusion::get;
81 
82 // [6.1.3.3] Tuple helper classes
83 using ::boost::fusion::tuple_size;
84 using ::boost::fusion::tuple_element;
85 
86 }}
87 
88 #endif
89 
90 #endif
91 
92 
93