8 Jul
2013
8 Jul
'13
8:02 a.m.
Andrey Semashev wrote:
Sid Sacek wrote:
You mentioned in an earlier mail that you would prefer that size() return a value like -1 in such a case. That also feels very strange to me; i.e. returning a size_t but reserving a value like -1 to indicate unknown size.
+1, I hate magic values.
You are right, I also have a dislike for magic values. In my last email, I suggested using 0 for unknown buffer sizes. I believe zero is not a magic number, and it suggests a zero-sized buffer, which is harmless. -Sid Sacek