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