Boost logo

Boost :

From: Markus Schöpflin (markus.schoepflin_at_[hidden])
Date: 2002-09-20 06:35:48


Hello,

the appended patch makes the tuple library compile on more compilers.
Especially it makes use of BOOST_NESTED_TEMPLATE for this. Could anyone
please apply it, maybe also on the release branch?

Thanks, Markus

Index: tuple_basic.hpp
===================================================================
RCS file: /cvsroot/boost/boost/boost/tuple/detail/tuple_basic.hpp,v
retrieving revision 1.15
diff -u -r1.15 tuple_basic.hpp
--- tuple_basic.hpp 9 May 2002 17:26:37 -0000 1.15
+++ tuple_basic.hpp 20 Sep 2002 11:28:15 -0000
@@ -108,12 +108,12 @@
   template<class RET, class HT, class TT >
   inline static RET get(const cons<HT, TT>& t)
   {
- return get_class<N-1>::template get<RET>(t.tail);
+ return get_class<N-1>::BOOST_NESTED_TEMPLATE get<RET>(t.tail);
   }
   template<class RET, class HT, class TT >
   inline static RET get(cons<HT, TT>& t)
   {
- return get_class<N-1>::template get<RET>(t.tail);
+ return get_class<N-1>::BOOST_NESTED_TEMPLATE get<RET>(t.tail);
   }
 };
 
@@ -190,7 +190,7 @@
                   typename element<N, cons<HT, TT> >::type
>::non_const_type
 get(cons<HT, TT>& c BOOST_TUPLE_DUMMY_PARM) {
- return detail::get_class<N>::template
+ return detail::get_class<N>::BOOST_NESTED_TEMPLATE
          get<
            typename access_traits<
              typename element<N, cons<HT, TT> >::type
@@ -205,7 +205,7 @@
                   typename element<N, cons<HT, TT> >::type
>::const_type
 get(const cons<HT, TT>& c BOOST_TUPLE_DUMMY_PARM) {
- return detail::get_class<N>::template
+ return detail::get_class<N>::BOOST_NESTED_TEMPLATE
          get<
            typename access_traits<
              typename element<N, cons<HT, TT> >::type
@@ -332,6 +332,7 @@
 
   typedef HT head_type;
   typedef null_type tail_type;
+ typedef cons<HT, null_type> self_type;
 
   typedef typename
     detail::wrap_non_storeable_type<head_type>::type stored_head_type;
@@ -379,7 +380,7 @@
 
   template <int N>
   typename access_traits<
- typename element<N, cons>::type
+ typename element<N, self_type>::type
>::non_const_type
   get(BOOST_TUPLE_SINGLE_DUMMY_PARM) {
     return boost::tuples::get<N>(*this);
@@ -387,7 +388,7 @@
 
   template <int N>
   typename access_traits<
- typename element<N, cons>::type
+ typename element<N, self_type>::type
>::const_type
   get(BOOST_TUPLE_SINGLE_DUMMY_PARM) const {
     return boost::tuples::get<N>(*this);


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk