From 6d2cb1d793837454b6d387c7fc12382cf6a87acf Mon Sep 17 00:00:00 2001 From: John Maddock Date: Sun, 14 Apr 2002 11:45:32 +0000 Subject: [PATCH] Fixed VC7 compile problems (thanks to Sofus Mortensen). [SVN r13482] --- .../detail/tuple_basic_no_partial_spec.hpp | 53 +++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/include/boost/tuple/detail/tuple_basic_no_partial_spec.hpp b/include/boost/tuple/detail/tuple_basic_no_partial_spec.hpp index 415d798..ec45df1 100644 --- a/include/boost/tuple/detail/tuple_basic_no_partial_spec.hpp +++ b/include/boost/tuple/detail/tuple_basic_no_partial_spec.hpp @@ -246,6 +246,58 @@ namespace tuples { namespace detail { +#if defined(BOOST_MSVC) && (BOOST_MSVC == 1300) + // special workaround for vc7: + + template + struct reference_adder + { + template + struct rebind + { + typedef T& type; + }; + }; + + template <> + struct reference_adder + { + template + struct rebind + { + typedef T type; + }; + }; + + + // Return a reference to the Nth type of the given Tuple + template + struct element_ref + { + private: + typedef typename element::RET elt_type; + enum { is_ref = is_reference::value }; + + public: + typedef reference_adder::rebind::type RET; + typedef RET type; + }; + + // Return a const reference to the Nth type of the given Tuple + template + struct element_const_ref + { + private: + typedef typename element::RET elt_type; + enum { is_ref = is_reference::value }; + + public: + typedef reference_adder::rebind::type RET; + typedef RET type; + }; + +#else // vc7 + // Return a reference to the Nth type of the given Tuple template struct element_ref @@ -269,6 +321,7 @@ namespace tuples { typedef typename add_reference::type RET; typedef RET type; }; +#endif // vc7 } // namespace detail