Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c++ > #123695

Re: A neat hash table implementation

From wij <wyniijj5@gmail.com>
Newsgroups comp.lang.c++
Subject Re: A neat hash table implementation
Date 2026-04-10 21:11 +0800
Organization A noiseless patient Spider
Message-ID <baa67c36a78da1ef64c205ad4880eeb7615d5947.camel@gmail.com> (permalink)
References (1 earlier) <10r9rj9$qfob$1@raubtier-asyl.eternal-september.org> <20260410131006.00007680@yahoo.com> <10rallk$115f6$1@raubtier-asyl.eternal-september.org> <ca7eee2f1134ba8b581b04e342c9942ecff4bdcd.camel@gmail.com> <10raqnu$12nem$1@raubtier-asyl.eternal-september.org>

Show all headers | View raw


On Fri, 2026-04-10 at 14:34 +0200, Bonita Montero wrote:
> Am 10.04.2026 um 13:50 schrieb wij:
> 
> > I doubt that.
> 
> You're right, this was 2min of work:
> 
> struct Key
> {
> 	string s;
> 	int i;
> 	float f;
> };
> 
> template<>
> struct std::hash<Key>
> {
> 	size_t operator ()( const Key &ky ) const noexcept
> 	{
> 		return hash<string>()( ky.s )
> 			^ hash<int>()( ky.i )
> 			^ hash<float>()( ky.f );
> 	}
> };
> 
> ...
> unordered_map<Key, int> umki;

Whenever you want to SEE a 'short and becautiful' case of usage, there will be 
one, you just write the library in the background for it yourself.

> > Clib has a principle (me thinks): Clib only contains those that app. (system
> > utilities, strictly) cannot do without.... So, basically, 'unbeatable'.
> > Many of your 'better implement' are false.
> 
> With C++ you write a fifth of the code you'd write in C.
> That isn't outweighed by the compilations times, even
> more not when you use modules.
> 
> > Your C++ (and c++ std-lib) is basically a macro language, ...
> 
> That's naive. Try that you can do with C++ containers
> f.e. unordered_map<K, V> with macros ...

You should ask what C++ (std library) provides that no app. codes can.

Back to comp.lang.c++ | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Re: A neat hash table implementation Michael S <already5chosen@yahoo.com> - 2026-04-10 13:13 +0300
  Re: A neat hash table implementation Bonita Montero <Bonita.Montero@gmail.com> - 2026-04-10 13:07 +0200
    Re: A neat hash table implementation wij <wyniijj5@gmail.com> - 2026-04-10 19:50 +0800
      Re: A neat hash table implementation Bonita Montero <Bonita.Montero@gmail.com> - 2026-04-10 14:34 +0200
        Re: A neat hash table implementation wij <wyniijj5@gmail.com> - 2026-04-10 21:11 +0800
          Re: A neat hash table implementation Bonita Montero <Bonita.Montero@gmail.com> - 2026-04-10 15:19 +0200
            Re: A neat hash table implementation wij <wyniijj5@gmail.com> - 2026-04-10 22:35 +0800
              Re: A neat hash table implementation Bonita Montero <Bonita.Montero@gmail.com> - 2026-04-10 17:07 +0200
                Re: A neat hash table implementation wij <wyniijj5@gmail.com> - 2026-04-11 00:16 +0800
                Re: A neat hash table implementation scott@slp53.sl.home (Scott Lurndal) - 2026-04-10 16:30 +0000
                Re: A neat hash table implementation Bonita Montero <Bonita.Montero@gmail.com> - 2026-04-10 18:50 +0200
                Re: A neat hash table implementation wij <wyniijj5@gmail.com> - 2026-04-11 01:40 +0800
                Re: A neat hash table implementation Bonita Montero <Bonita.Montero@gmail.com> - 2026-04-11 08:26 +0200
                Re: A neat hash table implementation wij <wyniijj5@gmail.com> - 2026-04-11 20:09 +0800
                Re: A neat hash table implementation Bonita Montero <Bonita.Montero@gmail.com> - 2026-04-11 14:29 +0200
              Re: A neat hash table implementation Michael S <already5chosen@yahoo.com> - 2026-04-10 18:12 +0300
                Re: A neat hash table implementation wij <wyniijj5@gmail.com> - 2026-04-11 00:26 +0800
        Re: A neat hash table implementation 🇵🇱Jacek Marcin Jaworski🇵🇱 <jmj@energokod.gda.pl> - 2026-04-10 16:38 +0200
          Re: A neat hash table implementation Bonita Montero <Bonita.Montero@gmail.com> - 2026-04-10 17:08 +0200
    Re: A neat hash table implementation wij <wyniijj5@gmail.com> - 2026-04-10 19:51 +0800

csiph-web