220 11701 <CALd5_c=M1gsL0WJ7ydOO5ML0xFMA5VVvotCsGuGyDxzCKZ47aA@mail.gmail.com> article
Path: news.gmane.org!not-for-mail
From: "J. Daniel Garcia" <josedaniel.garcia@uc3m.es>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Value constraints (or contract programming in C++)
Date: Tue, 8 Jul 2014 22:12:03 +0200
Lines: 138
Approved: news@gmane.org
Message-ID: <CALd5_c=M1gsL0WJ7ydOO5ML0xFMA5VVvotCsGuGyDxzCKZ47aA@mail.gmail.com>
References: <fb0e45e5-4838-453e-8da7-70a4d8c00d32@isocpp.org>
 <CAFk2RUYJap9GeX+DBoPOY1vyFVkHatetfgs5jAcM8D2Wm+KMrQ@mail.gmail.com>
 <befe0668-7ce5-4a0e-8004-d23c89dcbb1c@isocpp.org> <CAOU91OOuM9HOSTNo-NvbCGrnENoStNSi=KbtJ+B0yovjM1F-DQ@mail.gmail.com>
 <CAOU91OOPe-bTz5Z8U8r9T1YTiF_9q0sKp97_miBys+0hQhB=gg@mail.gmail.com>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: multipart/alternative; boundary=20cf301cc0c8dff3b004fdb43681
X-Trace: ger.gmane.org 1404850372 15481 80.91.229.3 (8 Jul 2014 20:12:52 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Tue, 8 Jul 2014 20:12:52 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBCFIPGWXVYIRBPFB6GOQKGQE4RQ7BDI@isocpp.org Tue Jul 08 22:12:46 2014
Return-path: <std-proposals+bncBCFIPGWXVYIRBPFB6GOQKGQE4RQ7BDI@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-ve0-f197.google.com ([209.85.128.197])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBCFIPGWXVYIRBPFB6GOQKGQE4RQ7BDI@isocpp.org>)
	id 1X4bkr-0004AK-QB
	for gclcip-std-proposals@m.gmane.org; Tue, 08 Jul 2014 22:12:46 +0200
Original-Received: by mail-ve0-f197.google.com with SMTP id jx11sf5037786veb.0
        for <gclcip-std-proposals@m.gmane.org>; Tue, 08 Jul 2014 13:12:45 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:mime-version:sender:in-reply-to:references:from
         :date:message-id:subject:to:x-original-sender
         :x-original-authentication-results:reply-to:precedence:mailing-list
         :list-id:list-post:list-help:list-archive:list-subscribe
         :list-unsubscribe:content-type;
        bh=usoWZRpsKwvi06C/mJ50Rej0xU5+3w5TucXY32M2Yfw=;
        b=JOqsZ4O6qZz6EOw+cP5jksKimA2yQncw6NjA/DGWIXfNcASyxbPbm+tXkF0ffpwJ5W
         NrQnjJYZKz6bPUBV9mnlHBx68hRPteMu0BFsLAGb/Ufau/VZVPx1jSOUO6Tmi1L7EbME
         0yFxDjUW6NY9MG2g//AvqDcDcCxLQise3j9P9lRoz1DEbWnZXxa3p/BXRsRBVn1s6u4c
         jCFPO2u94NXchuw2ruO9q6REr6UHD3w7Obo5PJ6nDXWKp2sC24IRI9mZoYjnzm48dQH/
         3RvQqdH2FFufJJTpy0VmuMXy5HdTqaLi+1iYGqeed4Cjf7c4uAFvT6AwNAVyB6ARY1Ps
         R48Q==
X-Gm-Message-State: ALoCoQnxNwsVehw5x5nFwXS6jpsKgpLoQkXSH9vlkusroB4eIwBSFTyI+JPC1syXPhOGhRLuEKzh
X-Received: by 10.236.67.103 with SMTP id i67mr8616138yhd.56.1404850364994;
        Tue, 08 Jul 2014 13:12:44 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.50.153.15 with SMTP id vc15ls521800igb.42.gmail; Tue, 08 Jul
 2014 13:12:43 -0700 (PDT)
X-Received: by 10.51.17.34 with SMTP id gb2mr6871105igd.16.1404850363907;
        Tue, 08 Jul 2014 13:12:43 -0700 (PDT)
Original-Received: from mail-ie0-x22f.google.com (mail-ie0-x22f.google.com [2607:f8b0:4001:c03::22f])
        by mx.google.com with ESMTPS id ef4si4556265igb.28.2014.07.08.13.12.43
        for <std-proposals@isocpp.org>
        (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128);
        Tue, 08 Jul 2014 13:12:43 -0700 (PDT)
Received-SPF: pass (google.com: domain of josedaniel.garcia.uc3m@gmail.com designates 2607:f8b0:4001:c03::22f as permitted sender) client-ip=2607:f8b0:4001:c03::22f;
Original-Received: by mail-ie0-f175.google.com with SMTP id at20so2540147iec.6
        for <std-proposals@isocpp.org>; Tue, 08 Jul 2014 13:12:43 -0700 (PDT)
X-Received: by 10.42.51.204 with SMTP id f12mr43399292icg.21.1404850363388;
 Tue, 08 Jul 2014 13:12:43 -0700 (PDT)
Original-Sender: josedaniel.garcia.uc3m@gmail.com
Original-Received: by 10.64.227.41 with HTTP; Tue, 8 Jul 2014 13:12:03 -0700 (PDT)
In-Reply-To: <CAOU91OOPe-bTz5Z8U8r9T1YTiF_9q0sKp97_miBys+0hQhB=gg@mail.gmail.com>
X-Original-Sender: josedaniel.garcia@uc3m.es
X-Original-Authentication-Results: mx.google.com;       spf=pass (google.com:
 domain of josedaniel.garcia.uc3m@gmail.com designates 2607:f8b0:4001:c03::22f
 as permitted sender) smtp.mail=josedaniel.garcia.uc3m@gmail.com;
       dkim=pass header.i=@gmail.com
Precedence: list
Mailing-list: list std-proposals@isocpp.org; contact std-proposals+owners@isocpp.org
List-ID: <std-proposals.isocpp.org>
X-Google-Group-Id: 399137483710
List-Post: <http://groups.google.com/a/isocpp.org/group/std-proposals/post>, <mailto:std-proposals@isocpp.org>
List-Help: <http://support.google.com/a/isocpp.org/bin/topic.py?topic=25838>, <mailto:std-proposals+help@isocpp.org>
List-Archive: <http://groups.google.com/a/isocpp.org/group/std-proposals/>
List-Subscribe: <http://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>,
 <mailto:std-proposals+subscribe@isocpp.org>
List-Unsubscribe: <http://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>,
 <mailto:googlegroups-manage+399137483710+unsubscribe@googlegroups.com>
Xref: news.gmane.org gmane.comp.lang.c++.isocpp.proposals:11701
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/11701>

--20cf301cc0c8dff3b004fdb43681
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

Overloading is a compile-time feature.

Let's consider the following:

void f(int x) expects(x=3D0) {
  handle_zero(x);
}
void f(int x) expects(x!=3D0) {
  handle_non_zero(x)
}

void g() {
  int x =3D some_function();
  f(x);
}

Overloading on preconditions would mean that preconditions can be evaluated
at compile-time and this not the case. So, overloading on preconditions
does not seem feasible.

Please, also note that N4110 leaves compile-time preconditions as
out-of-scope and points out that they could be handled better as part of a
future extension of conecepts TS.
--
  J. Daniel



On Tue, Jul 8, 2014 at 6:55 PM, Klaim - Jo=C3=ABl Lamotte <mjklaim@gmail.co=
m>
wrote:

> Andrzej, one thing I've been wondering while reading your paper (and
> N4110, I'm in the middle right now)
> is: should contracts have a role in overload resolution and if yes how?
> I know it's early to get into specifics but maybe your paper could at
> least mention the question?
>
> =E2=80=8B
>
> --
>
> ---
> 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.
> Visit this group at
> http://groups.google.com/a/isocpp.org/group/std-proposals/.
>

--=20

---=20
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 e=
mail to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposa=
ls/.

--20cf301cc0c8dff3b004fdb43681
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Overloading is a compile-time feature.<div><br></div><div>=
Let&#39;s consider the following:</div><div><br></div><div>void f(int x) ex=
pects(x=3D0) {</div><div>=C2=A0 handle_zero(x);</div><div>}</div><div>void =
f(int x) expects(x!=3D0) {</div>

<div>=C2=A0 handle_non_zero(x)</div><div>}</div><div><br></div><div>void g(=
) {</div><div>=C2=A0 int x =3D some_function();</div><div>=C2=A0 f(x);</div=
><div>}</div><div><br></div><div>Overloading on preconditions would mean th=
at preconditions can be evaluated at compile-time and this not the case. So=
, overloading on preconditions does not seem feasible.</div>

<div><br></div><div>Please, also note that N4110 leaves compile-time precon=
ditions as out-of-scope and points out that they could be handled better as=
 part of a future extension of conecepts TS.</div><div>--</div><div>=C2=A0 =
J. Daniel</div>

<div><br></div><div class=3D"gmail_extra"><br clear=3D"all"><div><div dir=
=3D"ltr"><br></div></div><div class=3D"gmail_quote">On Tue, Jul 8, 2014 at =
6:55 PM, Klaim - Jo=C3=ABl Lamotte <span dir=3D"ltr">&lt;<a href=3D"mailto:=
mjklaim@gmail.com" target=3D"_blank">mjklaim@gmail.com</a>&gt;</span> wrote=
:<br>

<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex"><div dir=3D"ltr">Andrzej, one thing I&#39;ve=
 been wondering while reading your paper (and N4110, I&#39;m in the middle =
right now)<div>

is: should contracts have a role in overload resolution and if yes how?</di=
v><div>I know it&#39;s early to get into specifics but maybe your paper cou=
ld at least mention the question?</div>
<div><br></div>=E2=80=8B</div><div class=3D"HOEnZb"><div class=3D"h5">

<p></p>

-- <br>
<br>
--- <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" target=3D"_=
blank">std-proposals+unsubscribe@isocpp.org</a>.<br>
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org" target=3D"_blank">std-proposals@isocpp.org</a>.<br>
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/" target=3D"_blank">http://groups.google.com/a/isocpp.org/gro=
up/std-proposals/</a>.<br>
</div></div></blockquote></div><br></div></div>

<p></p>

-- <br />
<br />
--- <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 />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

--20cf301cc0c8dff3b004fdb43681--

.
