Topic: includes vs set_includes


Author: Ken@Alverson.net ("Ken Alverson")
Date: Wed, 4 Sep 2002 21:58:44 +0000 (UTC)
Raw View
"Hyman Rosen" <hyrosen@mail.com> wrote in message
news:1031160828.652514@master.nyc.kbcfp.com...
> Ken Alverson wrote:
> > Huh...there it is.  Why doesn't it have a "set_" prefix like all the
> > other set algorithms?
>
> Because it's applicable to more than sets.
> The whole point of STL was to separate algorithms from containers.

So are all the set_* algorithms.  The "set_" prefix on the algorithm
name refers to the fact it works with logical sets (aka sorted ranges),
not the set<> type specifically (although the set<> type certainly
applies).

includes has the same input requirements as the other set routines, and
is just as much a logical set operation as intersection or union, etc.
The only difference is the output is a boolean instead of a result set.
It seems inconsistant for includes not to be called set_includes, or at
least no one has offered a convincing argument as to why includes is so
different that it deserves an inconsistant name.

Ken


---
[ 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    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html                       ]