public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* Re: PATCH: TR1 unordered associative containers
       [not found] <39885D64-813E-11D9-BB2D-000A95AA5E5E@apple.com>
@ 2005-02-19 18:17 ` Geoffrey Keating
  2005-02-19 20:44   ` Matt Austern
  0 siblings, 1 reply; 4+ messages in thread
From: Geoffrey Keating @ 2005-02-19 18:17 UTC (permalink / raw)
  To: Matt Austern; +Cc: gcc-patches

Matt Austern <austern@apple.com> writes:

Hi Matt,

Looks pretty neat!  However,

> +   tr1_hashtable_define_trivial_hash(float);
> +   tr1_hashtable_define_trivial_hash(double);
> +   tr1_hashtable_define_trivial_hash(long double);

cast-to-int probably isn't a very good hash function for
floating-point values...

> +   #undef tr1_hashtable_define_trivial_hash
> +
> +   template <typename T>
> +     struct hash<T*> {
> +       std::size_t operator()(T* p) const {
> + 	return reinterpret_cast<std::size_t>(p);
> +       }
> +     };
> +
> +   // ??? We can probably find a better hash function than this (i.e.
> one
> +   // that vectorizes better and that produces a more uniform
> distribution).
> +
> +   // XXX String hash probably shouldn't be an inline member function,
> +   // since it's nontrivial.  Once we have the framework for TR1 .cc
> +   // files, this should go in one.

And like this function, there's a problem: once you put this in an
inline function in a shipping compiler, even once, you're stuck with
it forever; that is, you can't change the function after that point.
So I think it'd be best to put them in a .cc file in the first commit.

> + // XXX This is a hack.  prime_rehash_policy's member functions, and
> + // certainly the list of primes, should be defined in a .cc file.
> + // We're temporarily putting them in a header because we don't have a
> + // place to put TR1 .cc files yet.  There's no good reason for any of
> + // prime_rehash_policy's member functions to be inline, and there's
> + // certainly no good reason for X<> to exist at all.

Likewise, this, and that'd be really annoying.  Especially if you
later wanted to extend the list of primes.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: PATCH: TR1 unordered associative containers
  2005-02-19 18:17 ` PATCH: TR1 unordered associative containers Geoffrey Keating
@ 2005-02-19 20:44   ` Matt Austern
  2005-02-19 22:12     ` Kai Henningsen
  0 siblings, 1 reply; 4+ messages in thread
From: Matt Austern @ 2005-02-19 20:44 UTC (permalink / raw)
  To: Geoffrey Keating; +Cc: gcc-patches

On 18 Feb 2005 16:49:31 -0800, Geoffrey Keating <geoffk@geoffk.org> wrote:

> And like this function, there's a problem: once you put this in an
> inline function in a shipping compiler, even once, you're stuck with
> it forever; that is, you can't change the function after that point.
> So I think it'd be best to put them in a .cc file in the first commit.

I agree that putting this in a .cc file is a really good idea. 
However, remember that this is TR1 stuff, not standard stuff.  This
means two things.

First, I don't think binary compatibility means as much for this as
for the standard library.  Everything in TR1 is semi-experimental by
definition.

Second, before we have any .cc files, we need to figure out what to do
with them.  They can't go into libstdc++.dylib, precisely because
they're not as solid as the standard library.  Probably this means we
need to come up with some new library just for the TR.

                --Matt

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: PATCH: TR1 unordered associative containers
  2005-02-19 20:44   ` Matt Austern
@ 2005-02-19 22:12     ` Kai Henningsen
  2005-02-19 23:42       ` Gabriel Dos Reis
  0 siblings, 1 reply; 4+ messages in thread
From: Kai Henningsen @ 2005-02-19 22:12 UTC (permalink / raw)
  To: gcc-patches

austern@gmail.com (Matt Austern)  wrote on 18.02.05 in <98604e9d0502181950c6bc69d@mail.gmail.com>:

> Second, before we have any .cc files, we need to figure out what to do
> with them.  They can't go into libstdc++.dylib, precisely because
> they're not as solid as the standard library.  Probably this means we
> need to come up with some new library just for the TR.

Or maybe a library for all non-standard stuff not needed to implement the  
standard stuff - I seem to recall there are a few more things, like ropes?  
Or are they gone already?

MfG Kai

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: PATCH: TR1 unordered associative containers
  2005-02-19 22:12     ` Kai Henningsen
@ 2005-02-19 23:42       ` Gabriel Dos Reis
  0 siblings, 0 replies; 4+ messages in thread
From: Gabriel Dos Reis @ 2005-02-19 23:42 UTC (permalink / raw)
  To: Kai Henningsen; +Cc: gcc-patches, libstdc++

kaih@khms.westfalen.de (Kai Henningsen) writes:

| austern@gmail.com (Matt Austern)  wrote on 18.02.05 in <98604e9d0502181950c6bc69d@mail.gmail.com>:
| 
| > Second, before we have any .cc files, we need to figure out what to do
| > with them.  They can't go into libstdc++.dylib, precisely because
| > they're not as solid as the standard library.  Probably this means we
| > need to come up with some new library just for the TR.
| 
| Or maybe a library for all non-standard stuff not needed to implement the  
| standard stuff

Among the non-standard stuff, there are things that are kind of stable
and things that are really experimental.  TR1 really *is experimental*. 
We do noone a favour if we put all non-standard stuff in the same
bucket.  

-- Gaby

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2005-02-19 17:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <39885D64-813E-11D9-BB2D-000A95AA5E5E@apple.com>
2005-02-19 18:17 ` PATCH: TR1 unordered associative containers Geoffrey Keating
2005-02-19 20:44   ` Matt Austern
2005-02-19 22:12     ` Kai Henningsen
2005-02-19 23:42       ` Gabriel Dos Reis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).