Topic: Why isn't there a heap class?


Author: kprateek88@yahoo.com (Prateek R Karandikar)
Date: Mon, 6 Sep 2004 15:23:13 GMT
Raw View
TC++PL :(1.8): [1][a] "If you can
think of "it" as a separate idea, make it a class."

Why isn't there a heap class, instead of functions like
std::make_heap()?

--                                    --
Abstraction is selective ignorance.
-Andrew Koenig
--                                    --

---
[ 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                       ]





Author: "dietmar_kuehl@yahoo.com" <dietmar_kuehl@yahoo.com>
Date: Tue, 7 Sep 2004 03:06:02 GMT
Raw View
Hi,
Prateek R Karandikar wrote:
> Why isn't there a heap class, instead of functions like
> std::make_heap()?

You might want to have a look at 'std::priority_queue'. This
class is specified and [probably (*)] implemented in terms of
the generic heap functions.

(*) Whether an implementation really uses these functions is
up to the implementation.
--
<mailto:dietmar_kuehl@yahoo.com> <http://www.dietmar-kuehl.de/>
<http://www.contendix.com> - Software Development & Consulting

---
[ 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                       ]





Author: wade@stoner.com (Bill Wade)
Date: Tue, 7 Sep 2004 22:30:11 GMT
Raw View
kprateek88@yahoo.com (Prateek R Karandikar) wrote in message news:<607f883e.0409050146.67e9841b@posting.google.com>...
> TC++PL :(1.8): [1][a] "If you can
> think of "it" as a separate idea, make it a class."
>
> Why isn't there a heap class, instead of functions like
> std::make_heap()?

If you want prior art:

Some heap classes were once submitted to boost.  I think they've since
been removed, but it looks like some fossils are still at
http://guinness.cs.stevens.edu/packages/boost/libs/pri_queue/

HTH

---
[ 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                       ]