
29 Mar
2011
29 Mar
'11
5:41 p.m.
On 29/03/2011 19:24, Olaf van der Spek wrote:
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.
iterator_range is a pair of iterators. In the case of iterator_range<const unsigned char*>, it's a pair of pointers. It only includes what you instruct it to. Use boost::as_literal to construct an iterator_range from a string literal.