X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=boost%2Fboost%2Ftuple%2Ftuple.hpp;h=7703597e10ce1a53abb0ed35bec3d24482941fb9;hb=43c09d723435a5b203f2ac0c39e2086de836b386;hp=bd39730dc130ecde138b9fa611bff0b49056d05a;hpb=70479c5282509b94f1c5c71db680b7f2d88db96a;p=lyx.git diff --git a/boost/boost/tuple/tuple.hpp b/boost/boost/tuple/tuple.hpp index bd39730dc1..7703597e10 100644 --- a/boost/boost/tuple/tuple.hpp +++ b/boost/boost/tuple/tuple.hpp @@ -1,15 +1,10 @@ // tuple.hpp - Boost Tuple Library -------------------------------------- -// Copyright (C) 1999, 2000 Jaakko Järvi (jaakko.jarvi@cs.utu.fi) +// Copyright (C) 1999, 2000 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi) // -// Permission to copy, use, sell and distribute this software is granted -// provided this copyright notice appears in all copies. -// Permission to modify the code and to distribute modified code is granted -// provided this copyright notice appears in all copies, and a notice -// that the code was modified is included with the copyright notice. -// -// This software is provided "as is" without express or implied warranty, -// and with no claim as to its suitability for any purpose. +// 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 @@ -18,6 +13,13 @@ #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 "boost/config.hpp" #include "boost/static_assert.hpp" @@ -27,10 +29,62 @@ #else // other compilers -#include "boost/tuple/reference_wrappers.hpp" +#include "boost/ref.hpp" #include "boost/tuple/detail/tuple_basic.hpp" #endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION +namespace boost { + +using tuples::tuple; +using tuples::make_tuple; +using tuples::tie; +#if !defined(BOOST_NO_USING_TEMPLATE) +using tuples::get; +#elif !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) +// +// 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); +} +#else // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION +// +// MSVC, using declarations don't mix with templates well, +// so use forwarding functions instead: +// +template +typename tuples::detail::element_ref >::RET +get(tuples::cons& t, tuples::detail::workaround_holder* = 0) +{ + return tuples::detail::get_class::get(t); +} + +template +typename tuples::detail::element_const_ref >::RET +get(const tuples::cons& t, tuples::detail::workaround_holder* = 0) +{ + return tuples::detail::get_class::get(t); +} +#endif // BOOST_NO_USING_TEMPLATE + +} // end namespace boost + -#endif // BOOST_TUPLE_HPP +#endif // BOOST_TUPLE_HPP