Boost logo

Boost :

Subject: Re: [boost] Interest in StaticVector - fixed capacity vector
From: Nathan Ridge (zeratul976_at_[hidden])
Date: 2011-10-14 11:53:34

> I was thinking about that, but from what I've read on the list it
> seems people prefer clearer and more correct english in the function
> names whenever possible.
> The one I keep coming across is:
> put_back()
> Does that currently imply anything I'm not thinking of? It seems like
> something someone would look up if they haven't seen it, then use it
> correctly. It does not directly imply unchecked, but it does seem
> appropriate.

The names put_back() vs. push_back() suggest absolutely nothing about
how these functions might be different. I'd much prefer a name that's
descriptive, like unchecked_push_back, even if it's longer and clumsier.

It seems the main options that have been proposed are:

  * push_back and unchecked_push_back
  * checked_push_back and push_back
  * just push_back, with behaviour controlled by a policy

This might be overkill, but we can make everyone happy by
having all three:

  * 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.


Boost list run by bdawes at, gregod at, cpdaniel at, john at