Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:52:55

0001 //  tuple.hpp - Boost Tuple Library --------------------------------------
0002 
0003 // Copyright (C) 1999, 2000 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi)
0004 //
0005 // Distributed under the Boost Software License, Version 1.0. (See
0006 // accompanying file LICENSE_1_0.txt or copy at
0007 // http://www.boost.org/LICENSE_1_0.txt)
0008 
0009 // For more information, see http://www.boost.org
0010 
0011 // -----------------------------------------------------------------
0012 
0013 #ifndef BOOST_TUPLE_HPP
0014 #define BOOST_TUPLE_HPP
0015 
0016 #if defined(__sgi) && defined(_COMPILER_VERSION) && _COMPILER_VERSION <= 730
0017 // Work around a compiler bug.
0018 // boost::python::tuple has to be seen by the compiler before the
0019 // boost::tuple class template.
0020 namespace boost { namespace python { class tuple; }}
0021 #endif
0022 
0023 #include <boost/config.hpp>
0024 #include <boost/static_assert.hpp>
0025 
0026 // other compilers
0027 #include <boost/core/ref.hpp>
0028 #include <boost/tuple/detail/tuple_basic.hpp>
0029 
0030 
0031 namespace boost {
0032 
0033 using tuples::tuple;
0034 using tuples::make_tuple;
0035 using tuples::tie;
0036 #if !defined(BOOST_NO_USING_TEMPLATE)
0037 using tuples::get;
0038 #else
0039 //
0040 // The "using tuples::get" statement causes the
0041 // Borland compiler to ICE, use forwarding
0042 // functions instead:
0043 //
0044 template<int N, class HT, class TT>
0045 inline typename tuples::access_traits<
0046                   typename tuples::element<N, tuples::cons<HT, TT> >::type
0047                 >::non_const_type
0048 get(tuples::cons<HT, TT>& c) {
0049   return tuples::get<N,HT,TT>(c);
0050 }
0051 // get function for const cons-lists, returns a const reference to
0052 // the element. If the element is a reference, returns the reference
0053 // as such (that is, can return a non-const reference)
0054 template<int N, class HT, class TT>
0055 inline typename tuples::access_traits<
0056                   typename tuples::element<N, tuples::cons<HT, TT> >::type
0057                 >::const_type
0058 get(const tuples::cons<HT, TT>& c) {
0059   return tuples::get<N,HT,TT>(c);
0060 }
0061 
0062 #endif // BOOST_NO_USING_TEMPLATE
0063 
0064 } // end namespace boost
0065 
0066 #if !defined(BOOST_NO_CXX11_HDR_TUPLE)
0067 
0068 #include <tuple>
0069 #include <cstddef>
0070 
0071 namespace std
0072 {
0073 
0074 #if defined(BOOST_CLANG)
0075 # pragma clang diagnostic push
0076 # pragma clang diagnostic ignored "-Wmismatched-tags"
0077 #endif
0078 
0079 // std::tuple_size
0080 
0081 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10>
0082     class tuple_size< boost::tuples::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> >:
0083         public boost::tuples::length< boost::tuples::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> >
0084 {
0085 };
0086 
0087 template<class H, class T> class tuple_size< boost::tuples::cons<H, T> >:
0088     public boost::tuples::length< boost::tuples::cons<H, T> >
0089 {
0090 };
0091 
0092 template<> class tuple_size< boost::tuples::null_type >:
0093     public boost::tuples::length< boost::tuples::null_type >
0094 {
0095 };
0096 
0097 // std::tuple_element
0098 
0099 template<std::size_t I, class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10>
0100     class tuple_element< I, boost::tuples::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> >:
0101         public boost::tuples::element< I, boost::tuples::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> >
0102 {
0103 };
0104 
0105 template<std::size_t I, class H, class T> class tuple_element< I, boost::tuples::cons<H, T> >:
0106     public boost::tuples::element< I, boost::tuples::cons<H, T> >
0107 {
0108 };
0109 
0110 #if defined(BOOST_CLANG)
0111 # pragma clang diagnostic pop
0112 #endif
0113 
0114 } // namespace std
0115 
0116 #endif // !defined(BOOST_NO_CXX11_HDR_TUPLE)
0117 
0118 #endif // BOOST_TUPLE_HPP