
"Thorsten Ottosen" <nesotto@cs.auc.dk> writes:
"Anthony Williams" <anthony_w.geo@yahoo.com> wrote in message news:y8akdel6.fsf@yahoo.com... | "Thorsten Ottosen" <nesotto@cs.auc.dk> writes:
| > well' that the behavior currently. The string algorithms rely on this | > behavior. | | Which string algorithms exactly? The functions in the standard that deal with | null-terminated strings all deal with char * and const char *, rather than | arrays.
the string algorithms in boost. (probably one of those libararies you never use either)
I don't use them, but I did look at the docs and a couple of headers, and couldn't see anywhere where char arrays were used explicitly --- everything seemed to be a reference to a container of some type passed as a parameter. [Aside: I really must familiarize myself with more of the boost libs; the ones I do use are really handy] Aha --- the collection traits identify that end(some_char_array) is found using std::char_traits<char>::length. That makes sense for string algorithms, and is not the one-less-than-the-array-size you suggested. I still think that using such a specialized interpretation of char[] when used with for(:) would be a bad plan. A special case such as this is best introduced using special case syntax: char someString[]="fred"; for(char x: nts_array(someString)) doStuff(x); Anthony -- Anthony Williams Software Developer