Boost logo

Boost :

From: jbandela_at_[hidden]
Date: 2000-10-02 12:21:02


Forgive me if I am misunderstanding your post, but if Iterator is a
pointer, Iterator::value_type won't be defined.

John Bandela

--- In boost_at_[hidden], "Boris Fomitchev" <fbp_at_s...> wrote:
> Looks like ISPTR used as a discriminator for full class
> specialization
> will work if ISCONST used as a secondary discriminator and member
> template classes work :
>
> template <bool is_ptr, bool is_const>
> struct iterator_traits_helper
> {
> template <class Iterator> class iterator_traits_base {
> typedef typename Iterator::value_type value_type;
> ...
> }
> };
>
> 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...
>
>
> -Boris.


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