
10 May
2005
10 May
'05
9:27 p.m.
Pavol Droba wrote:
Yet I understand you reservations, but the only way out of this problem would be to define different boost::end() for string ranges. I'm not sure if this is an acceptable way.
This is pretty much what I was saying. Looking for a NULL terminator is only acceptable when you know that you are dealing with NULL-terminated strings. If I'm writing generic code that works on C arrays, I'll use N as the size of T[N]. If I'm writing generic code that works on strings, I'll use N-1 or strlen. I won't use the Range library in either of these cases because it tries to guess which one I need.