
27 Jun
2005
27 Jun
'05
8:20 p.m.
"Peter Dimov" <pdimov@mmltd.net> writes:
Yes. Why wouldn't you want this function to require that condition? Anything else is a coding error.
I am reluctant to label it a coding error ("should never happen in a correct program"), because in general it can be very hard to ensure that the condition isn't violated. It's a bit like:
Requires: a particular state of the library that you have no way of querying.
Harrumph. Isn't it the archive under construction whose state is constrained? If you know you've put 5 elements in a vector, you don't have to query it before calling pop_back(), do you? -- Dave Abrahams Boost Consulting www.boost-consulting.com