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


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

Re: 2020 C++

From Tim Rentsch <tr.17687@z991.linuxsc.com>
Newsgroups comp.lang.c++
Subject Re: 2020 C++
Date 2019-08-06 09:31 -0700
Organization A noiseless patient Spider
Message-ID <86lfw645ob.fsf@mailhub.linuxsc.com> (permalink)
References (2 earlier) <qhbod2$bkb$1@dont-email.me> <qhbqcn$lle$1@dont-email.me> <gptalvFfkneU1@mid.individual.net> <qhc07t$l99$1@dont-email.me> <qhctrd$1556$1@gioia.aioe.org>

Show all headers | View raw


Manfred writes:

> [C++20 to have "concepts"]
>
> To this point I think that, even if the feature itself is really good,
> the name "concept" is just a bad choice.

Me too.  "Concept" is a terrible choice of name for this
construct.

> They are in fact requirements on template arguments, that Alex
> Stepanov named as concepts with what looks to me a sort of
> philosophical jump:
> apparently he assumes that that a set of requirements on "something"
> is what defines such "something", and it is therefore identical to the
> concept of such "something".
>
> Now, while this may be an excellent argument for discussion, IMHO it
> is just confusing when applied into a programming language (and
> possibly one of the reasons for the tormented gestation of the
> feature).  Personally I would have preferred a name more directly
> coupled to "requirement" as in fact they are (we already have typedef,
> typereq might have been something clearer).

The name "constraint" isn't quite right because a C++ "concept"
doesn't yet constrain anything;  it is more like what might be
called a "constraint-in-waiting".

The name "requirement" isn't quite right for much the same kinds
of reasons:  by itself a C++ "concept" doesn't require anything.
We might call it a "statement of requirements", if that phrase
weren't so cumbersome.  Also there are parts of C++ "concepts"
that use the keyword 'requires' and might themselves be called
"requirements", which is confusing.

A name I am starting to warm up to is "property".  It fits with
lots of the examples on the cppreference page:  the "Hashable"
property, the "Incrementable" property, the "Addable" property,
etc.  When attaching a 'requires' constraint to a type T, we can
say "T must have the Hashable property", which to my ears sounds
better than "T must satisfy the Hashable requirements".

Just my thoughts, for what that might be worth.

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


Thread

2020 C++ woodbrian77@gmail.com - 2019-07-24 19:10 -0700
  Re: 2020 C++ "Alf P. Steinbach" <alf.p.steinbach+usenet@gmail.com> - 2019-07-25 04:45 +0200
    Re: 2020 C++ Bonita Montero <Bonita.Montero@gmail.com> - 2019-07-25 10:25 +0200
    Re: 2020 C++ Juha Nieminen <nospam@thanks.invalid> - 2019-07-25 08:40 +0000
    Re: 2020 C++ woodbrian77@gmail.com - 2019-07-25 07:49 -0700
      Re: 2020 C++ David Brown <david.brown@hesbynett.no> - 2019-07-25 19:13 +0200
    Re: 2020 C++ JiiPee <no@notvalid.com> - 2019-08-07 13:10 +0100
  Re: 2020 C++ David Brown <david.brown@hesbynett.no> - 2019-07-25 10:05 +0200
    Re: 2020 C++ "Alf P. Steinbach" <alf.p.steinbach+usenet@gmail.com> - 2019-07-25 10:14 +0200
      Re: 2020 C++ David Brown <david.brown@hesbynett.no> - 2019-07-25 10:48 +0200
        Re: 2020 C++ Bo Persson <bo@bo-persson.se> - 2019-07-25 11:22 +0200
          Re: 2020 C++ David Brown <david.brown@hesbynett.no> - 2019-07-25 12:28 +0200
            Re: 2020 C++ lightness1024@gmail.com - 2019-07-25 03:57 -0700
            Re: 2020 C++ Jorgen Grahn <grahn+nntp@snipabacken.se> - 2019-07-25 14:16 +0000
              Re: 2020 C++ David Brown <david.brown@hesbynett.no> - 2019-07-25 19:19 +0200
            Re: 2020 C++ Manfred <noname@add.invalid> - 2019-07-25 20:53 +0200
              Re: 2020 C++ Tim Rentsch <tr.17687@z991.linuxsc.com> - 2019-08-06 09:31 -0700
                Re: 2020 C++ Fran <flitterio@gmail.com> - 2019-08-06 16:05 -0400
                Re: 2020 C++ Tim Rentsch <tr.17687@z991.linuxsc.com> - 2019-08-09 10:44 -0700

csiph-web