
-----Original Message----- From: boost-bounces@lists.boost.org [mailto:boost-bounces@lists.boost.org] On Behalf Of Andrew Hundt Sent: Friday, October 14, 2011 5:04 PM To: boost@lists.boost.org Subject: Re: [boost] Interest in StaticVector - fixed capacity vector
* unchecked_push_back which does what it says; AND * checked_push_back which does what it says; AND * push_back which calls one or the other based on a policy
That leaves just one thing to quibble about - the default value of the policy - but even that choice becomes less important, because those who feel strongly about the default behaviour of push_back being one or the other can just use the explicitly-named version instead.
I love the sound of design-by-committee in the morning :-)
More seriously, I do think that makes sense since it allows the user to select the appropriate function for their design, but use the alternate one when necessary.
If this is what is finally settled on, I would prefer to default to a checked policy because then it will catch and prevent mistakes by default. If you have an exceptional reason for the performance, you can switch to the alternate function/policy.
I also prefer checked by default. But it is true that a policy solution will impose a run-time penalty? Can't it be a compile-time choice? Of course, there still remains opportunity for the design-by-committee members to discuss what the default should be ;-) Paul --- Paul A. Bristow, Prizet Farmhouse, Kendal LA8 8AB UK +44 1539 561830 07714330204 pbristow@hetp.u-net.com