From: catphive on 20 Apr 2010 15:47 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 20 Apr 2010 21:13 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! ]
|
Pages: 1 Prev: need help learning c++ Next: [expr.prim.lambda] lambdas and non-captured, unevaluated operands |