From: catphive on
Josuttis' book has a nice table showing exception safety guarantees
for container operations on page 249; however, it only talks about
modifying operations.

It's common sense that non-modifying operations like size() and
empty() should have a no-throw guarantee, but I didn't notice anything
about it in Josuttis' book or the standard. Is this specified
somewhere I'm missing? Is it acceptable for non-modifying operations
like size() to throw for some standard containers?

It would be nice if there were a table of all standard functions with
their exception spec somewhere...

Thanks,
Brendan

--
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]

From: Ilya Sokolov on
catphive wrote:
> It's common sense that non-modifying operations like size() and
> empty() should have a no-throw guarantee, but I didn't notice anything
> about it in Josuttis' book or the standard. Is this specified
> somewhere I'm missing?

No. There was a proposal by Rani Sharoni titled 'Improving the standard
library�s exception specifications'
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/n2815.html


--
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]