
On Tue, Mar 29, 2011 at 7:07 PM, Yakov Galka <ybungalobill@gmail.com> wrote:
boost::iterator_range<const char*> is a sequence of bytes/chars, that is what pair<const void*,size_t> represents. It solves this case completely, but only that case.
Using const void* allows the callee to easily pass whatever he wants, using iterator_range<const unsigned char*> requires him to do an ugly cast. iterator_range also includes the terminator, which IMO is wrong.
The reason it doesn't solve the const std::string& case is because there is no consensus of what interface std::string should have (see recent string discussions from about two months ago). As per the current std::string
Will have a look.
non-mutable interface, it includes only the find.* family of functions, substr, compare and c_str. Most of these are already handled by Boost.String and Boost.Range. They can work with interator_range transparently. The only problem is c_str, which I don't know how you want to implement it for string_ref anyway.
c_str() can't be provided. -- Olaf