Boost Users :
From: David Abrahams (dave_at_[hidden])
Date: 2008-06-18 19:26:20
on Wed Jun 18 2008, Raider <sraider-AT-yandex.ru> wrote:
> Can anyone tell why boost 1.35 dropped support of boost::begin()/end()
> for zero terminated strings (const char*/wchar_t*)?
Because it was evil in generic code. An array of char was interpreted
as being as long as the initial sequence of nonzero elements, but an
array of anything else was interpreted as being as long as the array.
You might ask why we didn't make it so that char(&)[N] was interpreted
as an array of length N but char* was interpreted as a null-terminated
string that only has forward iterators (to avoid O(N) "random access"
operations, which are also evil in generic code)... I'm not entirely
sure of the answer to that.
-- Dave Abrahams BoostPro Computing http://www.boostpro.com
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net