// tuple.hpp - Boost Tuple Library -------------------------------------- // Copyright (C) 1999, 2000 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi) // // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // For more information, see http://www.boost.org // ----------------------------------------------------------------- #ifndef BOOST_TUPLE_HPP #define BOOST_TUPLE_HPP #if defined(__sgi) && defined(_COMPILER_VERSION) && _COMPILER_VERSION <= 730 // Work around a compiler bug. // boost::python::tuple has to be seen by the compiler before the // boost::tuple class template. namespace boost { namespace python { class tuple; }} #endif #include #include // other compilers #include #include namespace boost { using tuples::tuple; using tuples::make_tuple; using tuples::tie; #if !defined(BOOST_NO_USING_TEMPLATE) using tuples::get; #else // // The "using tuples::get" statement causes the // Borland compiler to ICE, use forwarding // functions instead: // template inline typename tuples::access_traits< typename tuples::element >::type >::non_const_type get(tuples::cons& c) { return tuples::get(c); } // get function for const cons-lists, returns a const reference to // the element. If the element is a reference, returns the reference // as such (that is, can return a non-const reference) template inline typename tuples::access_traits< typename tuples::element >::type >::const_type get(const tuples::cons& c) { return tuples::get(c); } #endif // BOOST_NO_USING_TEMPLATE } // end namespace boost #if !defined(BOOST_NO_CXX11_HDR_TUPLE) #include #include namespace std { #if defined(BOOST_CLANG) # pragma clang diagnostic push # pragma clang diagnostic ignored "-Wmismatched-tags" #endif // std::tuple_size template class tuple_size< boost::tuples::tuple >: public boost::tuples::length< boost::tuples::tuple > { }; template class tuple_size< boost::tuples::cons >: public boost::tuples::length< boost::tuples::cons > { }; template<> class tuple_size< boost::tuples::null_type >: public boost::tuples::length< boost::tuples::null_type > { }; // std::tuple_element template class tuple_element< I, boost::tuples::tuple >: public boost::tuples::element< I, boost::tuples::tuple > { }; template class tuple_element< I, boost::tuples::cons >: public boost::tuples::element< I, boost::tuples::cons > { }; #if defined(BOOST_CLANG) # pragma clang diagnostic pop #endif } // namespace std #endif // !defined(BOOST_NO_CXX11_HDR_TUPLE) #endif // BOOST_TUPLE_HPP