|
Boost : |
Subject: Re: [boost] Iterator Range and operator==
From: Daryle Walker (darylew_at_[hidden])
Date: 2012-04-23 10:12:34
> From: zeratul6@@@hotmail.com
> Date: Sun, Apr 12 :::::: +00<<
>
>
> The current behaviour of Boost.Range is consistent with the
> bvehaviour of the C++ range-based for loop, where
>
> for (char e : "hello") {}
>
> iterates times, but
>
> for (char e : std::string("hello")) {}
>
> iterates times.
>
> I think it's important to retain this consistency. (Whether
> the C++ behaviour is desirable to begin with, is of course
> a different question).
For a generic function that handles arrays:
template < typename T, std::size_t N >int hash( const T (&x)[N] );
It should do all elements. An array of char or wchar_t (or the new C++11 character types) may not be astring, a conceptual whole; it could be a collection of independent objects, like any other element type.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk