On 6/22/2012 6:06 PM, Andrew Stitcher wrote:
> Code just noticed in the Qpid C++ codebase:
>
> string name(int value) const {
> ByValue::const_iterator i = byValue.find(value);
> if (i == byValue.end())
> throw Exception("Not a valid syslog value: " + value);
> return i->second;
> }
>
> Assuming that this function throws an exception what exception does it
> throw?
>
> When value is 0? value is 1? value is 100?
The question is sort of misleading. 'value' the integer parameter is
not related to the value of byValue.end(). The value of end() depends
on the kind of container ByValue is. If ByValue is a linked list, end()
can mean null. If it is an array, its value can be the address of the
size()+1 element.
Matt
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]