Boost logo

Boost :

From: Thorsten Ottosen (thorsten.ottosen_at_[hidden])
Date: 2008-01-12 07:18:00

brass goowy skrev:
> The Intro (intro.html) says, "Below are given a small
> example..."
> I think "Here is a small example..." would work.


> On that same page and other pages this is found:
> "Warning: support for null-terminated strings is deprecated
> and will disappear in the next Boost release (1.34)."

Yes, and in fact that behavior is gone in 1.35, but can be emulated by
means of a new function as_literal().

> utility_class.html says, "Recall that many default
> constructed iterators are singular..."
> I didn't find other uses of the word singular in the
> documentation and am not sure what you mean. Are you
> saying they are not meant to be range endpoints?

 From the standard 24.1:

"Iterators can also have singular values that are
not associated with any container. [ Example: After the declaration of
an uninitialized pointer x (as with int* x;), x
must always be assumed to have a singular value of a pointer. —end
example ] Results of most expressions are undefined
for singular values; the only exceptions are destroying an iterator that
holds a singular value and the assignment of a
non-singular value to an iterator that holds a singular value. In this
case the singular value is overwritten the same way
as any other value. Dereferenceable values are always non-singular."

> In the section on portability it says:
> "Notice also that some compilers cannot do function template ordering
> properly. In that case one must rely of range_result_iterator and a
> single function definition instead of overloaded versions for
> const and non-const arguments."
> Probably that should be "rely on range_result_iterator..."
> The history and acknowledgement page says, "The library have
> been under way for a long time..." Should be, "The library
> has been under..."

yep, thanks.

> I think the "sub" in the class name sub_range is kind of
> misleading. The documentation has the following:
> "Imagine that we have an algorithm that searches for a
> sub-string in a string. The result is an iterator_range,
> that delimits the match. We need to store the result from
> this algorithm. Here is an example of how we can do it with
> and without sub_range
> std::string str("hello");
> iterator_range<std::string::iterator> ir = find_first( str, "ll" );
> sub_range<std::string> sub = find_first( str, "ll" );"
> The docs also say, "The iterator_range class is templated on an
> Forward Traversal Iterator and should be used whenever fairly
> general code is needed. The sub_range class is templated on an
> Forward Range and it is less general, but a bit easier to use
> since its template argument is easier to specify. The biggest
> difference is, however, that a sub_range can propagate
> constness because it knows what a corresponding const_iterator is."
> The sample code that has a sub-string with either an
> iterator_range or sub_range and the description of the
> two classes don't give much basis for sub being in the
> name.

So you would just call it range? Possible, but difficult to do now.

> In that last paragraph I quoted, there are two places
> where it says, "an Forward." I think those should be
> "a Forward." And swapping "is" and "however" in the
> last sentence would make it easier to read.

Do other native native English speakers agree?

> I didn't find anything about serialization in the docs.
> iterator_range has an operator<<, but understandably no
> operator>>. Do you plan to add something in this area?

No. Don't Boost.Serialization have support for serializing a [begin,end)


Boost list run by bdawes at, gregod at, cpdaniel at, john at