Boost logo

Boost :

From: Martin Bonner (martin.bonner_at_[hidden])
Date: 2006-03-16 07:21:11


----Original Message----
From: boost-bounces_at_[hidden]
[mailto:boost-bounces_at_[hidden]] On Behalf Of John Maddock Sent:
16 March 2006 10:24 To: boost_at_[hidden]
Subject: Re: [boost] distance operation (24.3.4)

>> const char * is not a random access iterator because it is not an
>> output iterator, therfore not a forward iterator, therefore not a
>> bidirectional iterator and therefore not a random access iterator -
>> 24.1
>>
>> The iterator categories are defined in 24.1, iterator traits is
>> simply an aid to deducing that category for a given iterator. As it
>> happens, you have found a defect in the standard, that
>> itetarator_traits< const T * > reports the wrong category. Of
>> course my preferred fix would be to find a better category
>> definition so that 24.3.1.2 was correct <g>
>
> Hold your horses here: surely const char* most certainly *is* a random
> access iterator, albeit an immutable one. I don't see anything in
> 24.1 that
> requires OutputIterator semantics for anything except, well output
> iterators :-)
>
> Waiting to be shot down in flames yours, John.

Section 24.1, paragraph 3 says: "Forward iterators satisfy all the
requirements of the ... output iterators"

On the other hand, paragraph 4 says "A forward ... iterator can ... be
... constant". "Constant iterators do not satisfy the requirements for
output iterators".

I think there is a clear defect in the standard here.

>
> _______________________________________________
> Unsubscribe & other changes:
> http://lists.boost.org/mailman/listinfo.cgi/boost

-- 
Martin Bonner
Martin.Bonner_at_[hidden]
Pi Technology, Milton Hall, Ely Road, Milton, Cambridge, CB4 6WZ,
ENGLAND Tel: +44 (0)1223 203894

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