220 37073 <93e7e509-edf0-4df6-9b2f-555bba92a04a@isocpp.org> article
Path: news.gmane.org!.POSTED!not-for-mail
From: bastienpenava@gmail.com
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: specify concept implementation
Date: Mon, 26 Feb 2018 08:11:04 -0800 (PST)
Lines: 106
Approved: news@gmane.org
Message-ID: <93e7e509-edf0-4df6-9b2f-555bba92a04a@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_14543_1306320811.1519661464926"
X-Trace: blaine.gmane.org 1519661347 22102 195.159.176.226 (26 Feb 2018 16:09:07 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Mon, 26 Feb 2018 16:09:07 +0000 (UTC)
To: ISO C++ Standard - Future Proposals <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBCG3XHNI6IDRBGPD2DKAKGQER5DBDFI@isocpp.org Mon Feb 26 17:09:03 2018
Return-path: <std-proposals+bncBCG3XHNI6IDRBGPD2DKAKGQER5DBDFI@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-ua0-f197.google.com ([209.85.217.197])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBCG3XHNI6IDRBGPD2DKAKGQER5DBDFI@isocpp.org>)
	id 1eqLKn-0005BD-AZ
	for gclcip-std-proposals@m.gmane.org; Mon, 26 Feb 2018 17:09:01 +0100
Original-Received: by mail-ua0-f197.google.com with SMTP id g9sf10130370ual.8
        for <gclcip-std-proposals@m.gmane.org>; Mon, 26 Feb 2018 08:11:07 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=isocpp-org.20150623.gappssmtp.com; s=20150623;
        h=date:from:to:message-id:subject:mime-version:x-original-sender
         :reply-to:precedence:mailing-list:list-id:list-post:list-help
         :list-archive:list-subscribe:list-unsubscribe;
        bh=PQfbXpqjR1WbXghh2Fr7ReZkmZXMuOeNfHjUzx+Or1E=;
        b=XZ8DlI77WHHYh12jz2N9Ed9/+xMGBMVp6jv/wIGg9A5sccYhQ+3I86R849iD7B/GW9
         RWBTWvvCABSklNLvi0nuQIxJ3lbEOHPF+TQZyvjmzaIO5y5cGNy0LrZL46Y6jSmQjpot
         f9UPcPGX/T/SEHKFYSbNsa4V5/5T80YcR/y5k6hTHolXVgJt/1H3Knb/XkJeZuafNPR8
         +JbWp9Lb0wkZYn/jk+YhtipAO0gIPBwbr2I8nL1MQvqkbqWGUnNieKqd1LMCJW/Icc/f
         ux00QfKgUsLKFvRjKl1XUGrf60P4DeJSwMYSQndgZjGOdAxHSTVhSGgzY2XWjXKqhLIg
         Ouyg==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20161025;
        h=date:from:to:message-id:subject:mime-version:x-original-sender
         :reply-to:precedence:mailing-list:list-id:list-post:list-help
         :list-archive:list-subscribe:list-unsubscribe;
        bh=PQfbXpqjR1WbXghh2Fr7ReZkmZXMuOeNfHjUzx+Or1E=;
        b=egLBatiT//EvdQQEhdtbxPxeKcsrhJ4/Ea9fE7WY7lkwB6ts2QlMIWtLkGVDwNKB4R
         zD6+J4f3il/BaU36JewiS2CG0/Jl0ZlppiJAZgQhxUpYVvIMQYLP0Dd5W347L/4CsoY6
         D4N8jM3p9kNWhkkK8tQPzrKZrk0hOLU245EzflWl3OCmmG4NBBGq7CKLp/3DN6uVbUjI
         tdVWl2z2/Gq/Aesm/x5JcHOgKGLehczJK8P5UfLs0Jlkhk0HsefHVFIWLUCJM8DxHejI
         pqq+SFCthyzinaSLltvENnbwNotXapZOdW7Xeqp5nS47GRac2csPMpGoF9cqYxaKNHn4
         3Cwg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        h=x-gm-message-state:date:from:to:message-id:subject:mime-version
         :x-original-sender:reply-to:precedence:mailing-list:list-id
         :x-spam-checked-in-group:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe;
        bh=PQfbXpqjR1WbXghh2Fr7ReZkmZXMuOeNfHjUzx+Or1E=;
        b=kFKwJtDcaqRxM+iaVbd9DxjEZRVeZfXu8ScwZ8sUfu/yQzwWJ9gM6fkyEXpkYiDeTn
         S67yJHwkFa4Z3S/azyUQxDTQ37uce+ZtBbSCt5xym64K/n9z6KLHCUHuutHbZEYWOY83
         lMSa1nIrt9ydbA9zNz9jjQpdXpQkCkA2jWtsSjR6bDC2oQsQlPx9c0NGejJNCTtnG3Xi
         pYhRPWqNXO5cqQNY8wPE/kokdMdR02M8anIuEw7/1clwnXouyR/6tifv4sZZEWKn11lA
         9yeWI0xn9ElNLA9r4W+TpfWBH71itvklckQACVcZaxcMt4Pkui5zqHwR/bYc9L6P5RKr
         BH/w==
X-Gm-Message-State: APf1xPAS9pq3uRkuO+ea10fvR73mwqdLp0Y2UMuDnMgrvvkUI8hfweUU
	rDZspYYtZjK+GkW2yNv61Ytgig==
X-Google-Smtp-Source: AG47ELu3yLkN7IwpwuuADLxPzWLwKBpPgIxB/Lv+qjLUlU2RA6GQ3vrJlVn09RO0mXDr4a2daWVF5A==
X-Received: by 10.159.38.101 with SMTP id 92mr3781679uag.15.1519661467421;
        Mon, 26 Feb 2018 08:11:07 -0800 (PST)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.31.238.201 with SMTP id m192ls5189167vkh.1.gmail; Mon, 26 Feb
 2018 08:11:05 -0800 (PST)
X-Received: by 10.31.162.130 with SMTP id l124mr63528vke.0.1519661465450;
        Mon, 26 Feb 2018 08:11:05 -0800 (PST)
X-Original-Sender: BastienPenava@gmail.com
Precedence: list
Mailing-list: list std-proposals@isocpp.org; contact std-proposals+owners@isocpp.org
List-ID: <std-proposals.isocpp.org>
X-Spam-Checked-In-Group: std-proposals@isocpp.org
X-Google-Group-Id: 399137483710
List-Post: <https://groups.google.com/a/isocpp.org/group/std-proposals/post>, <mailto:std-proposals@isocpp.org>
List-Help: <https://support.google.com/a/isocpp.org/bin/topic.py?topic=25838>, <mailto:std-proposals+help@isocpp.org>
List-Archive: <https://groups.google.com/a/isocpp.org/group/std-proposals/>
List-Subscribe: <https://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>,
 <mailto:std-proposals+subscribe@isocpp.org>
List-Unsubscribe: <mailto:googlegroups-manage+399137483710+unsubscribe@googlegroups.com>,
 <https://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>
Xref: news.gmane.org gmane.comp.lang.c++.isocpp.proposals:37073
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/37073>

------=_Part_14543_1306320811.1519661464926
Content-Type: multipart/alternative; 
	boundary="----=_Part_14544_117551217.1519661464926"

------=_Part_14544_117551217.1519661464926
Content-Type: text/plain; charset="UTF-8"

Hi,

I believe it would be interesting to allow the users to state, when 
declaring a type, that he aims at implementing a specific concept.

template<class T>
concept ValueType = requires() { T::value; }

struct A : concept C
{
};

//once the type has been instantiated check that the concepts are valid 
with the new type.
//error: A doesn't satisfy the C concept. No A::value

I believe it would render the code easier to read by making explicit the 
intent of the writer.
It would also make debugging easier in case of an error when writing an 
implementation of a concept and
could be useful if/when the definition of a concept changed.

-- 
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
To view this discussion on the web visit https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/93e7e509-edf0-4df6-9b2f-555bba92a04a%40isocpp.org.

------=_Part_14544_117551217.1519661464926
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Hi,<div><br></div><div>I believe it would be interesting t=
o allow the users to state, when declaring a type, that he aims at implemen=
ting a specific concept.</div><div><br></div><div class=3D"prettyprint" sty=
le=3D"background-color: rgb(250, 250, 250); border-color: rgb(187, 187, 187=
); border-style: solid; border-width: 1px; word-wrap: break-word;"><code cl=
ass=3D"prettyprint"><div class=3D"subprettyprint"><span style=3D"color: #00=
8;" class=3D"styled-by-prettify">template</span><span style=3D"color: #660;=
" class=3D"styled-by-prettify">&lt;</span><span style=3D"color: #008;" clas=
s=3D"styled-by-prettify">class</span><span style=3D"color: #000;" class=3D"=
styled-by-prettify"> T</span><span style=3D"color: #660;" class=3D"styled-b=
y-prettify">&gt;</span><span style=3D"color: #000;" class=3D"styled-by-pret=
tify"><br></span><span style=3D"color: #008;" class=3D"styled-by-prettify">=
concept</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> </=
span><span style=3D"color: #606;" class=3D"styled-by-prettify">ValueType</s=
pan><span style=3D"color: #000;" class=3D"styled-by-prettify"> </span><span=
 style=3D"color: #660;" class=3D"styled-by-prettify">=3D</span><span style=
=3D"color: #000;" class=3D"styled-by-prettify"> requires</span><span style=
=3D"color: #660;" class=3D"styled-by-prettify">()</span><span style=3D"colo=
r: #000;" class=3D"styled-by-prettify"> </span><span style=3D"color: #660;"=
 class=3D"styled-by-prettify">{</span><span style=3D"color: #000;" class=3D=
"styled-by-prettify"> T</span><span style=3D"color: #660;" class=3D"styled-=
by-prettify">::</span><span style=3D"color: #000;" class=3D"styled-by-prett=
ify">value</span><span style=3D"color: #660;" class=3D"styled-by-prettify">=
;</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> </span><=
span style=3D"color: #660;" class=3D"styled-by-prettify">}</span><span styl=
e=3D"color: #000;" class=3D"styled-by-prettify"><br><br></span><span style=
=3D"color: #008;" class=3D"styled-by-prettify">struct</span><span style=3D"=
color: #000;" class=3D"styled-by-prettify"> A </span><span style=3D"color: =
#660;" class=3D"styled-by-prettify">:</span><span style=3D"color: #000;" cl=
ass=3D"styled-by-prettify"> </span><span style=3D"color: #008;" class=3D"st=
yled-by-prettify">concept</span><span style=3D"color: #000;" class=3D"style=
d-by-prettify"> C<br></span><span style=3D"color: #660;" class=3D"styled-by=
-prettify">{</span><span style=3D"color: #000;" class=3D"styled-by-prettify=
"><br></span><span style=3D"color: #660;" class=3D"styled-by-prettify">};</=
span><span style=3D"color: #000;" class=3D"styled-by-prettify"><br><br></sp=
an><span style=3D"color: #800;" class=3D"styled-by-prettify">//once the typ=
e has been instantiated </span><span style=3D"color: #800;" class=3D"styled=
-by-prettify">check that the concepts are valid with the new type.</span><s=
pan style=3D"color: #000;" class=3D"styled-by-prettify"><br></span><span st=
yle=3D"color: #800;" class=3D"styled-by-prettify">//error: A doesn&#39;t sa=
tisfy the C concept. No A::value</span><span style=3D"color: #000;" class=
=3D"styled-by-prettify"><br></span></div></code></div><div><br></div><div>I=
 believe it would render the code easier to read by making explicit the int=
ent of the writer.</div><div>It would also make debugging easier in case of=
 an error when writing an implementation of a concept and</div><div>could b=
e useful if/when the definition of a concept changed.</div></div>

<p></p>

-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/93e7e509-edf0-4df6-9b2f-555bba92a04a%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/93e7e509-edf0-4df6-9b2f-555bba92a04a=
%40isocpp.org</a>.<br />

------=_Part_14544_117551217.1519661464926--

------=_Part_14543_1306320811.1519661464926--

.
