------- Additional Comments From fw at deneb dot enyo dot de 2005-01-09 23:07 ------- There's no multiplication in the source code. The multiplication is an implementation detail. You can hardly use it to justify the semantics of the operation.
I would expect that std::bad_alloc is thrown. But I agree that the C++ standard isn't very clear in this area. The implementation must ensure that the postcondition in 5.3.4(10) holds, but the standard doesn't provide a means to signal failure. I'm going to post a note to comp.std.c++ on this matter, but hopefully this will be fixed in GCC as a quality of implementation issue. The necessary overflow check is should be very cheap because the multiplication is always by a constant. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19351