Boost logo

Boost :

From: Nicolai Josuttis (nico_at_[hidden])
Date: 2000-09-05 12:49:04


Oops, wrong subject...

Nicolai Josuttis wrote:
>
> I can easily insert the fix for private with Borland compilers:
> >#ifndef BOOST_NO_PRIVATE_IN_AGGREGATE
> > private:
> >#endif
>
> However I am not sure about the fix for iteraors:
> > David Abrahams wrote:
> > >>----- Original Message -----
> > >From: "Beman Dawes" beman_at_e...
> > >
> > >> First, to workaround VC++ broken std::reverse_iterator:
> > >>
> > >> // reverse iterator support
> > >> # if !defined(BOOST_MSVC) || BOOST_MSVC > 1200 // 1200 == VC++ 6.0
> > >> typedef std::reverse_iterator<iterator> reverse_iterator;
> > >> typedef std::reverse_iterator<const_iterator>
> > >> const_reverse_iterator;
> > >> # else
> > >> // workaround for broken VC++ reverse_iterator implementation
> > >> typedef std::reverse_iterator<iterator,T> reverse_iterator;
> > >> typedef std::reverse_iterator<const_iterator,T>
> > >> const_reverse_iterator;
> > >> # endif
> > >
> > >
> > >I think these fixes probably don't apply if using the STLport.
> >
> > Thanks, Dave!
> > I checked, and it turns out the issue is partial specialization (which is
> > for the standard compliant reverse_iterator). Both Microsoft and
> > STLport libraries (and probably others) use the workaround. Thus I think
> > the correct code is:
> >
> > if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
> > typedef std::reverse_iterator<iterator> reverse_iterator;
> > typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
> > # else
> > // workaround for broken reverse_iterator implementations due to no partial specialization
> > typedef std::reverse_iterator<iterator,T> reverse_iterator;
> > typedef std::reverse_iterator<const_iterator,T> const_reverse_iterator;
> > # endif
>
> Looking into the other MSVC headers and finding an existing constant in the
> boost config files
> how about this one?:
> #if !defined(BOOST_MSVC_STD_ITERATOR)
> typedef std::reverse_iterator<iterator> reverse_iterator;
> typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
> #else
> typedef std::reverse_iterator<iterator,value_type,reference,T*,difference_type> reverse_iterator;
> typedef std::reverse_iterator<const_iterator,value_type,const_reference,const T*,difference_type> const_reverse_iterator;
> #endif
>
> Note that on my MSVC version there are 5! iterator arguments while STLport semms
> to provide 4.
> Any thoughts?
>
> In addition, I still get errors when I try to compile array1.cpp due to the
> initialization.
> However, I don't have the actual version (Service Pack 3) installed.
> Does it really work with it?
>

Nico

-- 
Nicolai M. Josuttis          	http://www.josuttis.de/
Solutions in Time        	mailto:solutions_at_[hidden]

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