
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)." 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? 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..." In iterator_range.hpp a range is often declared with the name 'r' and then there is code like r.begin and r.end. In my opinion those are distractingly similar to rbegin and rend. I think something like rg.begin and rg.end would be an improvement. 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. 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. 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? iterator_range<list<int>::iterator> it_rng; oarch << it_rng; // would need to send the size .................... vector<int> vec; iarch >> vec; That seems useful. Brian Wood Ebenezer Enterprises www.webebenezer.net "They that trust in the L-rd shall be as mount Zion, which cannot be removed, but abides for ever." Psalm 125:1

brass goowy skrev:
The Intro (intro.html) says, "Below are given a small example..." I think "Here is a small example..." would work.
Thanks.
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) range? -Thorsten

Thorsten Ottosen wrote:
brass goowy skrev:
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?
I was also unfamiliar with that term; a note would be useful.
In that last paragraph I quoted, there are two places where it says, "an Forward." I think those should be "a Forward."
[not sure which bit your question is about]
Do other native native English speakers agree?
Yes. By chance, I just saw this in the changelog for the linux man pages: Justin Pryzby / mtk Fix incorrect usage of "a" and "an" before following vowel / consonant, by reviewing the output of the following scripts: for a in $(wc */*.? | awk '$1 > 10 {print $4}' | gv total); do echo $a MANWIDTH=4000 man -l $a 2>/dev/null | egrep '(^| )an [^aeiou][a-z]' done | less for a in $(wc */*.? | awk '$1 > 10 {print $4}' | gv total); do echo $a MANWIDTH=4000 man -l $a 2>/dev/null | \ egrep '(^| )a [aeiou][a-z]' done| less
And swapping "is" and "however" in the last sentence would make it easier to read.
Do other native native English speakers agree?
I would put "however" right at the start of the sentence. But that's not considered good style by some. Given the two options I would choose "The biggest difference, however, is that a ...". Phil.
participants (3)
-
brass goowy
-
Phil Endecott
-
Thorsten Ottosen