Boost logo

Boost :

From: Beman Dawes (beman_at_[hidden])
Date: 2000-08-31 09:18:42


David Abrahams wrote:
>
>----- Original Message -----
>From: "Beman Dawes" <beman_at_[hidden]>
>
>> 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
required 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

--Beman


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