|
Boost : |
From: Pavol Droba (droba_at_[hidden])
Date: 2003-10-31 07:03:07
On Thu, Oct 30, 2003 at 03:20:32PM -0500, Rob Stewart wrote:
> From: "Peter Dimov" <pdimov_at_[hidden]>
[snip]
> Given my now enlightened understanding of nth_element, I don't
> consider it analogous to find_nth() at all, so you can consider
> all of my capitulation above rescinded!
>
> Choosing a different name will resolve the problem as previously
> stated.
>
There has been a lot of arguments propesed in this matter, but I would
still prefer the current solution. The reasons are following:
Naming:
- It is clear what does it mean n-th element (modulo indexing problem).
So it is clear what does find_nth() do.
- find_index() implies that we are searching for an index not an element of
substring.
- find_occurence() is a very synonym of find(), it provides no information
about what occurence is actualy found
Indexing:
- 0-based index is widely accepted and understood by C/C++ developers.
- all C/C++ entities which use an indexing in some way use 0-based indexing
- even if 1-based index can sound more natural, I thing that breaking heavily
used convention is match worse.
- if the parameter name is changed to "index" it is clear, what base should be used
Over and out.
Pavol
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk