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


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

Re: map[string_view] not compiling

From Juha Nieminen <nospam@thanks.invalid>
Newsgroups comp.lang.c++
Subject Re: map[string_view] not compiling
Date 2022-08-03 10:49 +0000
Organization Aioe.org NNTP Server
Message-ID <tcdjrf$1dc1$1@gioia.aioe.org> (permalink)
References <tc8epl$t0hn$1@dont-email.me> <tcdff0$25305$1@dont-email.me>

Show all headers | View raw


Alf P. Steinbach <alf.p.steinbach@gmail.com> wrote:
>     using   std::less,
>             std::map,
>             std::out_of_range,
>             std::string,
>             std::string_view,
>             std::forward;

I love how you use 92 characters (and six lines of code) in order to
avoid writing "std::" three times, which would be a total of 15 characters.
Thus you saved a total of -77 characters and -6 lines of code.

>         private map<Key_, Item_, less<>>
>         using Std_map   = map<Key, Item, less<>>;
>                 throw out_of_range( "const-Map_::operator[] - no such 

While, at the same time, making the code less readable.
(Say what you want, but for example mixing "Map_" and "map" in the same
code is confusing. "std::map" would visually distinguish them much better.)

And why? What for? To this day this is a complete mystery to me.
(I most certainly do not subscribe to the brevity-over-clarity style of
programming.)

There's also a degree of irony in that "Std_map" name...

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


Thread

map[string_view] not compiling Paavo Helde <eesnimi@osa.pri.ee> - 2022-08-01 14:52 +0300
  Re: map[string_view] not compiling Bo Persson <bo@bo-persson.se> - 2022-08-01 14:32 +0200
    Re: map[string_view] not compiling Paavo Helde <eesnimi@osa.pri.ee> - 2022-08-01 17:11 +0300
      Re: map[string_view] not compiling Öö Tiib <ootiib@hot.ee> - 2022-08-01 13:30 -0700
        Re: map[string_view] not compiling Bo Persson <bo@bo-persson.se> - 2022-08-01 23:23 +0200
          Re: map[string_view] not compiling Öö Tiib <ootiib@hot.ee> - 2022-08-01 22:52 -0700
    Re: map[string_view] not compiling Andrey Tarasevich <andreytarasevich@hotmail.com> - 2022-08-04 08:31 -0700
  Re: map[string_view] not compiling "Alf P. Steinbach" <alf.p.steinbach@gmail.com> - 2022-08-03 11:34 +0200
    Re: map[string_view] not compiling Juha Nieminen <nospam@thanks.invalid> - 2022-08-03 10:49 +0000
      Re: map[string_view] not compiling "Alf P. Steinbach" <alf.p.steinbach@gmail.com> - 2022-08-03 13:38 +0200
        Re: map[string_view] not compiling Juha Nieminen <nospam@thanks.invalid> - 2022-08-04 06:16 +0000
    Re: map[string_view] not compiling Paavo Helde <eesnimi@osa.pri.ee> - 2022-08-03 14:43 +0300
      Re: map[string_view] not compiling "Alf P. Steinbach" <alf.p.steinbach@gmail.com> - 2022-08-03 13:56 +0200

csiph-web