Boost logo

Boost :

From: Arkadiy Vertleyb (vertleyb_at_[hidden])
Date: 2004-07-10 10:44:26

Alexander Nasonov wrote:

> ... and only in there saying:
> ../../../boost/typeof/typeof.hpp(37): error: more than one partial
specialization matches the template argument list of class
r0<boost::mpl::void_>, boost::mpl::int_<131093>>::type,
boost::mpl::int_<458770>>::type, const int *const>::type, const int [20]>"
> "boost::type_of::encode_type_impl<V, const T>"
> "boost::type_of::encode_type_impl<V, T [N]>"

Hmmm, do you think this is a compiler bug or a standard behavior? const
int[20] looks to me like an array of const integers, so I would definitely
expect the second specialization envoked, but maybe it's also legal to view
it something like a const integer that happens to be here 20 times? Do you
think similar problems are possible in other contexts?

> I'd suggest to use is_array in combination with mpl::if_:
> template<class V, class T> struct encode_type_impl;
> template<class V, class T> struct encode_type_impl_array; // HERE!
> template<class T, class Iter> struct decode_type_impl;
> template<class V, class T> struct encode_type
> : boost::mpl::if_<
> ::boost::is_array<T>,
> encode_type_impl_array<V, T>, // AND HERE!
> encode_type_impl<V, T>
> >::type
> {};
> Of course, you have to append _array to appropriate specialization of
> encode_type_impl.

#ifdeffed, as a workaround for Intel? Otherwise it may significantly affect
the compile time...


Boost list run by bdawes at, gregod at, cpdaniel at, john at