Article View: comp.std.c++
Article #4003STL/String naming scheme confusion
From: Nico Josuttis
Date: Fri, 12 Apr 1996 14:57
Date: Fri, 12 Apr 1996 14:57
49 lines
2371 bytes
2371 bytes
Hi,
Foregive me if I am wrong and sorry, if this sounds like a flame,
but if I try to find a naming scheme for STL
search/find algorithms, it all seems to be a confusion:
Consider:
| basic_string | STL algorithm
-----------------------------------------------------------------
find first elem | find() | find()
find last elem | rfind() | -
find first subrange | find() | search()
find last subrange | rfind() | find_end()
find first elem of range | find_first_of() | find_first_of()
find last elem of range | find_last_of() | -
Why don't we use the string naming scheme ?
- Why is search() not also called find() ?
- Why is find_end() not called rfind() ?
(I guess the missing algorithms do miss because
reverse iterators do the job)
OK, we had not many time but this is somehow typical
for inconsistences in the library and happened of course due
to historical reasons.
For example to append elements, we have
+=, append, push_back
But it would be possible to get more conistence with only a bit of
work. I think programmers will thank for it (oh certainly they won't,
but they won't flame so much).
And this is the last chance to make it more consistent.
Anything but historical reason against a change for that ?
Am I missing something ?
If not, I could try to make a full table for all such naming
inconsistences to have a base to discuss a consistent solution.
Nico
nico@bredex.de
[ comp.std.c++ is moderated. To submit articles: try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ FAQ: http://reality.sgi.com/employees/austern_mti/std-c++/faq.html ]
[ Policy: http://reality.sgi.com/employees/austern_mti/std-c++/policy.html ]
[ Comments? mailto:std-c++-request@ncar.ucar.edu ]
Technical Details
Message-ID:
<199604120728.JAA01452@bredex.bredex.de>Path:
arc1-ca.pugleaf.net!engnews1.Eng.Sun.COM!taumet!clamageShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!engnews1.Eng.Sun.COM!taumet!clamage From: Nico Josuttis <nico@bredex.de> Newsgroups: comp.std.c++ Subject: STL/String naming scheme confusion Date: 12 Apr 1996 14:57:23 GMT Organization: ? Approved: clamage@eng.sun.com (comp.std.c++) Message-ID: <199604120728.JAA01452@bredex.bredex.de> NNTP-Posting-Host: taumet.eng.sun.com Content-Length: 1520 X-Lines: 42 Originator: clamage@taumet