Topic: Containers


Author: Alain Migeon <agm@rovsing.dk>
Date: Wed, 24 Jan 2001 18:01:56 GMT
Raw View
Hi

I had today a post rejected from comp.lang.c++.moderated, because
hash_map and hash_set are not part of the C++ standard.

Is it planned anyway to officially add these containers inside the
standard, since many libraries now implements them?

Alain

---
[ 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.research.att.com/~austern/csc/faq.html                ]
[ Note that the FAQ URL has changed!  Please update your bookmarks.     ]





Author: comeau@panix.com (Greg Comeau)
Date: Wed, 24 Jan 2001 18:48:33 GMT
Raw View
In article <MPG.14d8e73ceb95106c9896cc@news.cybercity.dk>,
Alain Migeon  <agm@rovsing.dk> wrote:
>I had today a post rejected from comp.lang.c++.moderated, because
>hash_map and hash_set are not part of the C++ standard.
>
>Is it planned anyway to officially add these containers inside the
>standard, since many libraries now implements them?

I'll _guess_ some form of said will make its way in.  But there
are no official plans as of this date.
--
Greg Comeau                   Comeau C/C++ 4.2.44 "so close"
ONLINE COMPILER ==>           http://www.comeaucomputing.com/tryitout
comeau@comeaucomputing.com    http://www.comeaucomputing.com

---
[ 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.research.att.com/~austern/csc/faq.html                ]
[ Note that the FAQ URL has changed!  Please update your bookmarks.     ]





Author: Francis Glassborow <francis.glassborow@ntlworld.com>
Date: Wed, 24 Jan 2001 20:40:44 GMT
Raw View
In article <MPG.14d8e73ceb95106c9896cc@news.cybercity.dk>, Alain Migeon
<agm@rovsing.dk> writes
>Hi
>
>I had today a post rejected from comp.lang.c++.moderated, because
>hash_map and hash_set are not part of the C++ standard.

I am shocked by that, as I know most of the moderators, are you
absolutely certain that was the reason for rejection?

I think someone (you or the moderator) must have misunderstood, or there
was some very specific context that you have not told us about.

>
>Is it planned anyway to officially add these containers inside the
>standard, since many libraries now implements them?

--
Francis Glassborow
See http://www.accu.org for details of The ACCU Spring Conference, 2001
(includes many regular participants to C & C++ newsgroups)

---
[ 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.research.att.com/~austern/csc/faq.html                ]
[ Note that the FAQ URL has changed!  Please update your bookmarks.     ]





Author: James.Kanze@dresdner-bank.com
Date: Thu, 25 Jan 2001 17:15:58 GMT
Raw View
In article <BQ6VotABTzb6EwYg@ntlworld.com>,
  Francis Glassborow <francisG@robinton.demon.co.uk> wrote:
> In article <MPG.14d8e73ceb95106c9896cc@news.cybercity.dk>, Alain
> Migeon

> <agm@rovsing.dk> writes

> >I had today a post rejected from comp.lang.c++.moderated, because
> >hash_map and hash_set are not part of the C++ standard.

> I am shocked by that, as I know most of the moderators, are you
> absolutely certain that was the reason for rejection?

I'm surprised by it as well, and I'm a (not very active) moderator.
Generally speaking, questions about widely used features, whether in
the standard are not, are acceptable.  (Witness the long thread on
threads, although standard C++ doesn't support threading.)

> I think someone (you or the moderator) must have misunderstood, or
> there was some very specific context that you have not told us
> about.

More likely the moderator just hit the wrong button.  We're human, you
know.

--
James Kanze                               mailto:kanze@gabi-soft.de
Conseils en informatique orient   e objet/
                   Beratung in objektorientierter Datenverarbeitung
Ziegelh   ttenweg 17a, 60598 Frankfurt, Germany Tel. +49(069)63198627


Sent via Deja.com
http://www.deja.com/

---
[ 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.research.att.com/~austern/csc/faq.html                ]
[ Note that the FAQ URL has changed!  Please update your bookmarks.     ]





Author: James Kanze <kanze@gabi-soft.de>
Date: Mon, 29 Jan 2001 06:24:03 GMT
Raw View
Matthew Austern <austern@research.att.com> writes:

|>  Alain Migeon <agm@rovsing.dk> writes:

|>  > I had today a post rejected from comp.lang.c++.moderated, because
|>  > hash_map and hash_set are not part of the C++ standard.

|>  > Is it planned anyway to officially add these containers inside the
|>  > standard, since many libraries now implements them?

|>  I personally expect hash tables and singly link lists to become part
|>  of the next version of the C++ standard.  There are at least three
|>  shipping versions of hash tables, and the standardization committee
|>  will have to reconcile the differences.

Just curious, but any ideas on how great the differences are.  Is there
a usable common subset, or are they as different as night and day?

--
James Kanze                               mailto:kanze@gabi-soft.de
Conseils en informatique orient   e objet/
                   Beratung in objektorientierter Datenverarbeitung
Ziegelh   ttenweg 17a, 60598 Frankfurt, Germany Tel. +49(069)63198627

---
[ 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.research.att.com/~austern/csc/faq.html                ]
[ Note that the FAQ URL has changed!  Please update your bookmarks.     ]





Author: Herb Sutter <hsutter@acm.org>
Date: Tue, 30 Jan 2001 17:04:34 GMT
Raw View
James Kanze <kanze@gabi-soft.de> writes:
>Matthew Austern <austern@research.att.com> writes:
>|>  I personally expect hash tables and singly link lists to become part
>|>  of the next version of the C++ standard.  There are at least three
>|>  shipping versions of hash tables, and the standardization committee
>|>  will have to reconcile the differences.
>
>Just curious, but any ideas on how great the differences are.  Is there
>a usable common subset, or are they as different as night and day?

>From what I recall when this was discussed in a rump session in Kona:
Internally, the implementations are quite different even in some fundamental
design aspects. Interestingly, though, there's no difference in the calling
code syntax when using the various hash containers in "normal" ways -- the
implementations' main features are used identically, although I think some
do provide additional functionality.

Herb

---
Herb Sutter (mailto:hsutter@acm.org)

Contributing Editor, C/C++ Users Journal (http://www.cuj.com)

---
[ 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.research.att.com/~austern/csc/faq.html                ]
[ Note that the FAQ URL has changed!  Please update your bookmarks.     ]





Author: pierrebai@hotmail.com
Date: Wed, 31 Jan 2001 15:10:26 GMT
Raw View
In article <a5ec7tov73fe3lde7ekt81eqm079abaiah@4ax.com>,
  hsutter@acm.org wrote:
> James Kanze <kanze@gabi-soft.de> writes:
> >Matthew Austern <austern@research.att.com> writes:
> >Just curious, but any ideas on how great the differences are.  Is there
> >a usable common subset, or are they as different as night and day?
>
> >From what I recall when this was discussed in a rump session in Kona:
> Internally, the implementations are quite different even in some
fundamental
> design aspects. Interestingly, though, there's no difference in the
calling
> code syntax when using the various hash containers in "normal" ways -- the
> implementations' main features are used identically, although I think some
> do provide additional functionality.
>

If any new functionality is considered, I would really like that the
following two methods be added (and possibly added to std::map at the
same time):

  const data_type & find_data(const key_type& key, const data_type &
no_data) const;
  data_type & get_data(const key_type& __key)

find_data effects:

If the key is in the hash table then the corresponding value is
returned. In other word, this has the same effect as returing
find(key).second, but the intent is to avoid creating expensive iterators.

If the key is not in the hash table, then the value no_data is returned.

get_data effect:

If the key is in the hash table then the corresponding value is
returned. In other word, this has the same effect as returing
find(key).second, but the intent is to avoid creating expensive iterators.

If the key is not in the hash table, then the result of the call is
undefined. The intent is that no check is made, contrary to find_data(),
so as to provide an even greater performance gain when a key is known to
be in the table.

I have made measurement for my applications, and these two functions are
an essential speed improvement when a program does a lot of lookups. The
implementation complexity is extremely low as tey are essentially
strip-down version of find(). At least that is how I implemented them on
STLPort and the hash_map bundled with CodeWarrior.


Sent via Deja.com
http://www.deja.com/

---
[ 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.research.att.com/~austern/csc/faq.html                ]
[ Note that the FAQ URL has changed!  Please update your bookmarks.     ]