Path: csiph.com!news.swapon.de!eternal-september.org!feeder.eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: Tim Rentsch
Newsgroups: comp.lang.c++
Subject: Re: 2020 C++
Date: Tue, 06 Aug 2019 09:31:00 -0700
Organization: A noiseless patient Spider
Lines: 43
Message-ID: <86lfw645ob.fsf@mailhub.linuxsc.com>
References:
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Injection-Info: reader02.eternal-september.org; posting-host="b6859753d5e4d3224111b29bb4eccec1"; logging-data="4457"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19gcKIA2X/SGWKmCHNBAuQY5Qy51FaDFjw="
User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux)
Cancel-Lock: sha1:0pF05NSSw+qqKM0uEEA023VtKYA= sha1:1ZO7p2Rp+dVoIk5LvFShhxBW+Tg=
Xref: csiph.com comp.lang.c++:67335
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.