|
Boost : |
From: Toon Knapen (toon.knapen_at_[hidden])
Date: 2004-06-15 06:00:03
With a lot of help from Joaquin we've been able to succesfully compile
most of the multi_index library and some other libraries which use the
tuple library by using the attached patch. Is it OK to commit the patch?
In the final version also I intend to add a small comment in the code
why we need the workaround for IBM because AFAICT the problem is the
member-template-keyword:
For version 6.0 of VisualAge, BOOST_NO_MEMBER_TEMPLATE_KEYWORD is
intentially *not* defined. However in the attached patch you can see
that I removed the 'template' keyword and that this makes it work.
However sometimes putting the 'template' keyword makes it compile,
sometimes ommitting the keyword makes it compile and sometimes we never
succeed to compile such constructs (e.g. in the program-options
library). For instance I tested defining the
BOOST_NO_MEMBER_TEMPLATE_KEYWORD but the regression results overall were
worse.
Joaquín Mª López Muñoz wrote:
>
>
> Toon Knapen ha escrito:
>
>
>>Joaquín Mª López Muñoz wrote:
>>
>>
>>>Seems like Visual Age is having trouble deducing some
>>>implicit template parms inside tuples::get(). This is currently breaking
>>>
>>>Boost.MultiIndex and a test of Boost.Iterator.
>>>
>>>Please find below a very simple and totally conformant fix. This has not
>>>
>>>actually been tested with vacpp, but I checked it does not break
>>>anything
>>>with some other compilers.
>>>
>>>1. Could anybody check locally if this solves the aforementioned
>>>problems in
>>>vacpp?
Index: tuple_basic.hpp
===================================================================
RCS file: /cvsroot/boost/boost/boost/tuple/detail/tuple_basic.hpp,v
retrieving revision 1.23
diff -u -r1.23 tuple_basic.hpp
--- tuple_basic.hpp 28 Oct 2003 09:42:43 -0000 1.23
+++ tuple_basic.hpp 15 Jun 2004 10:26:17 -0000
@@ -97,12 +97,16 @@
template<class RET, class HT, class TT >
inline static RET get(const cons<HT, TT>& t)
{
+#ifndef __IBMCPP__
return get_class<N-1>::BOOST_NESTED_TEMPLATE get<RET>(t.tail);
+#else
+ return get_class<N-1>::get<RET>(t.tail);
+#endif
}
template<class RET, class HT, class TT >
inline static RET get(cons<HT, TT>& t)
{
- return get_class<N-1>::BOOST_NESTED_TEMPLATE get<RET>(t.tail);
+ return get_class<N-1>::get<RET>(t.tail);
}
};
@@ -194,11 +198,17 @@
typename element<N, cons<HT, TT> >::type
>::non_const_type
get(cons<HT, TT>& c BOOST_APPEND_EXPLICIT_TEMPLATE_NON_TYPE(int, N)) {
- return detail::get_class<N>::BOOST_NESTED_TEMPLATE
+#ifndef __IBMCPP__
+ return get_class<N>::BOOST_NESTED_TEMPLATE
+#else
+ return get_class<N>::
+#endif
get<
typename access_traits<
typename element<N, cons<HT, TT> >::type
- >::non_const_type>(c);
+ >::non_const_type,
+ HT,TT
+ >(c);
}
// get function for const cons-lists, returns a const reference to
@@ -209,11 +219,17 @@
typename element<N, cons<HT, TT> >::type
>::const_type
get(const cons<HT, TT>& c BOOST_APPEND_EXPLICIT_TEMPLATE_NON_TYPE(int, N)) {
+#ifndef __IBMCPP__
return detail::get_class<N>::BOOST_NESTED_TEMPLATE
+#else
+ return detail::get_class<N>::
+#endif
get<
typename access_traits<
typename element<N, cons<HT, TT> >::type
- >::const_type>(c);
+ >::const_type,
+ HT,TT
+ >(c);
}
// -- the cons template --------------------------------------------------
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk