220 32074 <58ECE695.8060601@gmail.com> article
Path: news.gmane.org!.POSTED!not-for-mail
From: Matthew Woehlke <mwoehlke.floss@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Non-last default arguments
Date: Tue, 11 Apr 2017 10:22:13 -0400
Lines: 59
Approved: news@gmane.org
Message-ID: <58ECE695.8060601@gmail.com>
References: <91d734b5-d1f2-773a-b5c2-3b96696a6f0f@scylladb.com>
 <CAFdMc-2Q8FyP-qqJCT-zDj4kfrqQ89G4qdWuWtVJAzDvFuOZ5w@mail.gmail.com>
 <a39f277a-549f-4b4a-881b-09fd1cf4087e@isocpp.org>
 <23242c11-a20b-9dfe-42fc-7a1ae3195849@scylladb.com>
 <d3ef1ce9-062d-4cb1-8001-0255edc86076@isocpp.org>
 <58EBA69B.2020902@gmail.com>
 <fb7458cb-d28c-4625-8a90-0a89b05a3622@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
X-Trace: blaine.gmane.org 1491920535 11845 195.159.176.226 (11 Apr 2017 14:22:15 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Tue, 11 Apr 2017 14:22:15 +0000 (UTC)
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101
 Thunderbird/38.1.0
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBC37LBFWUIFBBF6NWPDQKGQEINQPV5I@isocpp.org Tue Apr 11 16:22:11 2017
Return-path: <std-proposals+bncBC37LBFWUIFBBF6NWPDQKGQEINQPV5I@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-yw0-f200.google.com ([209.85.161.200])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBC37LBFWUIFBBF6NWPDQKGQEINQPV5I@isocpp.org>)
	id 1cxwgM-00030a-IP
	for gclcip-std-proposals@m.gmane.org; Tue, 11 Apr 2017 16:22:10 +0200
Original-Received: by mail-yw0-f200.google.com with SMTP id m6sf64061178ywe.6
        for <gclcip-std-proposals@m.gmane.org>; Tue, 11 Apr 2017 07:22:16 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=isocpp-org.20150623.gappssmtp.com; s=20150623;
        h=subject:to:references:newsgroups:from:message-id:date:user-agent
         :mime-version:in-reply-to:content-transfer-encoding
         :x-original-sender:x-original-authentication-results:reply-to
         :precedence:mailing-list:list-id:x-spam-checked-in-group:list-post
         :list-help:list-archive:list-subscribe:list-unsubscribe;
        bh=jjb+8ZPakSE8rddQtmf+1Tp17/3uPanacbhHmt/f7x0=;
        b=xN8RsFU2k370zPeXIzwQIySl1JBnoTfs4bPk4QeBHivAdtgpJSCVbMiLJUtWJ9R2q4
         9QVDXXVFMhRfVzEpsjTuWRd8PACEUqBHOADILoK6CEJT7FzobLFbS7dgo6n3N+E2Qc1j
         RlCsuSZ6cTEjvDpdMvwj9ck49VoPZ8c9buUBMEY70H51ejysvY2zwokEAN6qR8ZxZn2e
         m+V0dP0VIH5LzP9dBGsJv7Uqq1M+Fce+GvLj097boASetOsH49QLn8jXIsB9NaijKhxK
         RtaHFMGrMX27mRao/JQiVuYJBNnqJ3SKcl+ztDkQa3hll79KlTrMeaNT8Ja2ymD 
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        h=x-gm-message-state:subject:to:references:newsgroups:from:message-id
         :date:user-agent:mime-version:in-reply-to:content-transfer-encoding
         :x-original-sender:x-original-authentication-results:reply-to
         :precedence:mailing-list:list-id:x-spam-checked-in-group:list-post
         :list-help:list-archive:list-subscribe:list-unsubscribe;
        bh=jjb+8ZPakSE8rddQtmf+1Tp17/3uPanacbhHmt/f7x0=;
        b=pV71UzzhdLM+On+YFvwHDkIvhZLd13q0Luv+M3wBf5e6wB1cEpPh5vpz+yiv4B3zXc
         Q6D2LQTLimEz9qjUqYpFq+Lr6sAtcEdpEvsDfiWGZay/8ntthE2vaTVkuVNG7vRAz+Vg
         vV9LzIwwZfDsnMCRsbsRdqVHb98/WKdibIgtrnSLjtAQcu/K8uZ9RJG2h60SwqC/xhC6
         G7qNFrko5uy2YprYu1OHBPig9EYuvqzWY3o5Ce8/joccVxRpmU0PkzykwD0bcIe5Jkla
         QTBypWc8aDagGxE5FPP9PKmk3+1OdvBYcuNNtksRDui4tpqZ++xRsxCU8Fa 
X-Gm-Message-State: AFeK/H3RsGZhoYsZSXGOGk1rNTXrCJL2qJovHKnlggbarnStweF8LLgxkHEy68VpFAN8Dg==
X-Received: by 10.129.98.2 with SMTP id w2mr21822416ywb.28.1491920536458;
        Tue, 11 Apr 2017 07:22:16 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.157.14.141 with SMTP id 13ls2482974otj.25.gmail; Tue, 11 Apr
 2017 07:22:15 -0700 (PDT)
X-Received: by 10.129.173.23 with SMTP id l23mr4041527ywh.28.1491920535592;
        Tue, 11 Apr 2017 07:22:15 -0700 (PDT)
Original-Received: from mail-yb0-x235.google.com (mail-yb0-x235.google.com. [2607:f8b0:4002:c09::235])
        by mx.google.com with ESMTPS id j184si823981ybg.251.2017.04.11.07.22.15
        for <std-proposals@isocpp.org>
        (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
        Tue, 11 Apr 2017 07:22:15 -0700 (PDT)
Received-SPF: pass (google.com: domain of mwoehlke.floss@gmail.com designates 2607:f8b0:4002:c09::235 as permitted sender) client-ip=2607:f8b0:4002:c09::235;
Original-Received: by mail-yb0-x235.google.com with SMTP id i124so44013827ybc.3
        for <std-proposals@isocpp.org>; Tue, 11 Apr 2017 07:22:15 -0700 (PDT)
X-Received: by 10.37.216.141 with SMTP id p135mr20086333ybg.146.1491920535183;
        Tue, 11 Apr 2017 07:22:15 -0700 (PDT)
Original-Received: from [192.168.1.176] (tripoint.kitware.com. [66.194.253.20])
        by smtp.googlemail.com with ESMTPSA id w192sm7459521ywd.7.2017.04.11.07.22.14
        for <std-proposals@isocpp.org>
        (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
        Tue, 11 Apr 2017 07:22:14 -0700 (PDT)
Original-Newsgroups: gmane.comp.lang.c++.isocpp.proposals
In-Reply-To: <fb7458cb-d28c-4625-8a90-0a89b05a3622@isocpp.org>
X-Original-Sender: mwoehlke.floss@gmail.com
X-Original-Authentication-Results: mx.google.com;       dkim=pass
 header.i=@gmail.com;       spf=pass (google.com: domain of
 mwoehlke.floss@gmail.com designates 2607:f8b0:4002:c09::235 as permitted
 sender) smtp.mailfrom=mwoehlke.floss@gmail.com;       dmarc=pass (p=NONE
 sp=NONE dis=NONE) header.from=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: <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:32074
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/32074>

On 2017-04-10 23:10, Arthur O'Dwyer wrote:
> On Monday, April 10, 2017 at 8:37:03 AM UTC-7, Matthew Woehlke wrote:
>> On 2017-04-07 19:09, Arthur O'Dwyer wrote:=20
>>> You might look into how Boost does it with boost::use_default. I=20
>>> haven't looked myself and can't promise anything, but I gather
>>> that several Boost libraries have something like this:
>>>
>>> inline struct use_default_t {} use_default;=20
>>> template<class T, T default_value> struct defaulted {=20
>>>   optional<T> value;=20
>>>   defaulted(T);=20
>>>   defaulted(use_default_t);=20
>>>   operator T() const;=20
>>> };=20
>>>
>>> void f(defaulted<int, 1> a, defaulted<int, 2> b, defaulted<int, 3> c,=
=20
>>> defaulted<int, 4> d);=20
>>
>> Ugh; you've promoted changing the default from a SIC to a BIC.=20
>=20
> (I guess "SIC"=3D"syntactic interface change" and "BIC"=3D"binary interfa=
ce=20
> change". Consider spelling these abbreviations out on first reference.)

Anyone that has ever read qt-devel knows these. Alas, Google is
unusually unhelpful here.

SIC =E2=86=92 Source Incompatible Change
BIC =E2=86=92 Binary Incompatible Change

(There are also SC and BC =E2=86=92 Source/Binary Compatible.)

Actually, I realize that's slightly wrong. Changing a "normal" default
means that the code will still run, but recompiling will change the
behavior, so while it's technically both SC and BC, it is (potentially)
behavior breaking. (If done carefully, however, it can be okay to make
such a change.) Changing a "boost style default" not only (maybe)
changes behavior when the program is recompiled, it *is* an actual BIC,
i.e. your program will crash until it is recompiled because the ABI changed=
..

That makes it hard to argue that the above technique is an
"improvement". (There is an argument that the breakage alerts users to
the behavior change, but since it is SC, it's easy to miss if the
program gets rebuilt for some other reason.)

--=20
Matthew

--=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.
To view this discussion on the web visit https://groups.google.com/a/isocpp=
..org/d/msgid/std-proposals/58ECE695.8060601%40gmail.com.

.
