dmd 1.066 and 2.051 release

Caligo iteronvexor at gmail.com
Fri Dec 24 20:50:00 PST 2010


So what does one use in D if something like std::unordered_set is needed?
RedBlackTree is ordered as far as I can tell.

On Fri, Dec 24, 2010 at 6:08 PM, Jonathan M Davis <jmdavisProg at gmx.com>wrote:

> On Friday 24 December 2010 00:02:06 Caligo wrote:
> > Why are they calling it RedBlackTree? why not Set?  C++ std::set is a
> > red-black tree as far as I know, but they named it set.
>
> Andrei decided that the containers in Phobos will named after what they
> actually
> are instead of what they're used for. A prime example of this is a
> red-black
> tree. It can be used as a set. Depending on the implementation (I haven't
> look
> at the Phobos one yet), it can also be used as a map (it's used for both
> set and
> map in C++'s STL). But a set could be implemented in many different ways. A
> red-
> black tree is only one of them. It could be implemented with a hash
> instead. But
> that would give it very different performance characteristics.
>
> Phobos is taking the approach that a container is labeled for the data
> structure
> that it is rather than what it's used for. That way it's very clear what
> it's
> performance characteristics are. If you want to use the term Set in your
> code,
> then simply alias RedBlackTree to Set.
>
> - Jonathan M Davis
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d-announce/attachments/20101224/1a9d116a/attachment.html>


More information about the Digitalmars-d-announce mailing list