Boost logo

Boost :

From: Boris Fomitchev (fbp_at_[hidden])
Date: 2000-10-03 00:06:34


Well, in fact I did know about IF technique, just elaborated it a bit
here. So we do not have any remove_const<> solutions w/o partial
specialization ? That's a pity, as it would allow to implement fully
compliant iterator_traits for VC6 in STLport...

--- In boost_at_[hidden], Mat Marcus <mmarcus_at_o...> wrote:

> >template<>
> >struct iterator_traits_helper<true, true>
> >{
> > // we know for sure this guy is const T*
> > // remove_const template is supposed to remove const -- do we
have
> >that ???
> > template <class Iterator> class iterator_traits_base {
> > typedef typename remove_const<Iterator>::value_type
value_type;
> > ...
> > }
> >};
> >
> >template <class T>
> >struct iterator_traits : public
> >iterator_traits_helper::iterator_traits_base<IS_PTR<T>::Ret,
> >IS_CONST<T> > {
> >};
> >
> >The problem might be that VC6 might not work very well with
typedefs
> >inside member template classes...
>
> It looks like you have rediscovered the metactrl::IF technique.
> However the problem of determining the underlying type from a
pointer
> template parameter at compile time remains unsolved AFAIK.
>
> - Mat


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