Boost logo

Boost :

From: Eric Niebler (eric_at_[hidden])
Date: 2007-01-10 14:38:43


Thorsten Ottosen wrote:
> Eric Niebler wrote:
>> Consider the output of the following program:
>>
> >
>> It seems Boost.Range is still treating arrays of char and wchar_t
>> specially. IIRC, we decided long ago that it shouldn't.
>>
>> This is on HEAD, BTW.
>
> Fixed

Thanks. You might want to add a test for this as well <nudge>.

While we're at it, this trivial code fails to compile on msvc-7.1:

   int rg[5] = {};
   boost::begin(rg);

Clearly, it's a compiler bug. But the work-around is simple enough. In
range/begin.hpp, the begin() overloads have the following signatures:

   template< class T >
   typename range_iterator<T>::type begin( T& r )

   template< class T >
   typename range_iterator<const T>::type begin( const T& r )

If there were defined as follows:

   template< class T >
   typename range_mutable_iterator<T>::type begin( T& r )

   template< class T >
   typename range_const_iterator<T>::type begin( const T& r )

... the problem would go away, I think. Same is true for end(), size(),
etc...

HTH,

-- 
Eric Niebler
Boost Consulting
www.boost-consulting.com

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