
23 Apr
2012
23 Apr
'12
2:12 p.m.
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.