220 9260 <E35FEFAC-824A-4048-8304-754825C0D27E@gmail.com> article
Path: news.gmane.org!not-for-mail
From: David Krauss <potswa@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Re: add "implicit" keyword?
Date: Tue, 11 Feb 2014 14:19:09 +0800
Lines: 109
Approved: news@gmane.org
Message-ID: <E35FEFAC-824A-4048-8304-754825C0D27E@gmail.com>
References: <ldauqr$63v$1@ger.gmane.org> <CAGg_6+NJgqxP2B+J0oQ4xW1BqpeeSV4bqw_3XFODYAy0+9V4UA@mail.gmail.com> <ldb114$13r$1@ger.gmane.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0 (Mac OS X Mail 7.1 \(1827\))
Content-Type: multipart/alternative; boundary="Apple-Mail=_0F21165C-75C5-4D88-8F11-082EB40EA659"
X-Trace: ger.gmane.org 1392099551 32750 80.91.229.3 (11 Feb 2014 06:19:11 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Tue, 11 Feb 2014 06:19:11 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBCW25A7E3QCRBZMB46LQKGQEXJZLDRI@isocpp.org Tue Feb 11 07:19:19 2014
Return-path: <std-proposals+bncBCW25A7E3QCRBZMB46LQKGQEXJZLDRI@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-qa0-f71.google.com ([209.85.216.71])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBCW25A7E3QCRBZMB46LQKGQEXJZLDRI@isocpp.org>)
	id 1WD6gg-00027N-Oc
	for gclcip-std-proposals@m.gmane.org; Tue, 11 Feb 2014 07:19:19 +0100
Original-Received: by mail-qa0-f71.google.com with SMTP id j5sf15186594qaq.6
        for <gclcip-std-proposals@m.gmane.org>; Mon, 10 Feb 2014 22:19:18 -0800 (PST)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:from:message-id:mime-version:subject:date
         :references:to:in-reply-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=6WP1qU45dq9VuJcyMszSakiCinKFSqcwHXs8KNhMRgs=;
        b=fqJrYIAMjuty+RiMFkG6CyMFieUClMzY+ouZ4TWyHIxcBQ3VlhKKaa1MzjNTC4krJu
         1WwiPrO+GWgq2xF/MVWvC2NwDsfSP3Wh9q1MbbxDSlxBGOYSytSL0xN8KCsFrdOUeruA
         7lyEhWlowP3uBq2fk0JONip1wASC5qYBFOQL5KrQ1kGxJ+PdaFdGSDWphyu85nGBPNEw
         nC1QrCelykOjxC3yHqAjf17gZXsDNrUVAh3/5w/a/jXwxSTZUcRC7HuEfiJEThcXJSEU
         UEgBdcCSXitQbwBhPhpiRUnzkz6+H4Sl+YtJRsdEhb6FCOs8nfht8lL0+I4kDf5vRDoQ
         7ycQ==
X-Gm-Message-State: ALoCoQlzgdveuv0R1BDVBzB5XqQ/CsqdKI5FfCChIN6NZYoS/1Lrc+9UB3Qt4J133v3fFoQvcP7n
X-Received: by 10.236.98.104 with SMTP id u68mr9940623yhf.1.1392099557948;
        Mon, 10 Feb 2014 22:19:17 -0800 (PST)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.50.73.201 with SMTP id n9ls2368352igv.13.gmail; Mon, 10 Feb
 2014 22:19:16 -0800 (PST)
X-Received: by 10.68.133.229 with SMTP id pf5mr42645639pbb.115.1392099556907;
        Mon, 10 Feb 2014 22:19:16 -0800 (PST)
Original-Received: from mail-pd0-x234.google.com (mail-pd0-x234.google.com [2607:f8b0:400e:c02::234])
        by mx.google.com with ESMTPS id xu6si17830129pab.167.2014.02.10.22.19.16
        for <std-proposals@isocpp.org>
        (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128);
        Mon, 10 Feb 2014 22:19:16 -0800 (PST)
Received-SPF: pass (google.com: domain of potswa@gmail.com designates 2607:f8b0:400e:c02::234 as permitted sender) client-ip=2607:f8b0:400e:c02::234;
Original-Received: by mail-pd0-f180.google.com with SMTP id x10so7073687pdj.25
        for <std-proposals@isocpp.org>; Mon, 10 Feb 2014 22:19:16 -0800 (PST)
X-Received: by 10.66.233.71 with SMTP id tu7mr30505769pac.22.1392099556804;
        Mon, 10 Feb 2014 22:19:16 -0800 (PST)
Original-Received: from [172.20.10.2] ([121.54.54.43])
        by mx.google.com with ESMTPSA id si6sm128601496pab.19.2014.02.10.22.19.13
        for <std-proposals@isocpp.org>
        (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128);
        Mon, 10 Feb 2014 22:19:15 -0800 (PST)
In-Reply-To: <ldb114$13r$1@ger.gmane.org>
X-Mailer: Apple Mail (2.1827)
X-Original-Sender: potswa@gmail.com
X-Original-Authentication-Results: mx.google.com;       spf=pass (google.com:
 domain of potswa@gmail.com designates 2607:f8b0:400e:c02::234 as permitted
 sender) smtp.mail=potswa@gmail.com;       dkim=pass header.i=@gmail.com;
       dmarc=pass (p=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: <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:9260
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/9260>

--Apple-Mail=_0F21165C-75C5-4D88-8F11-082EB40EA659
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset=ISO-8859-1


On Feb 11, 2014, at 1:08 AM, Matthew Woehlke <mw_triad@users.sourceforge.ne=
t> wrote:

> Yes, but that's the same problem as with e.g. implicit switch fallthrough=
.. Some things can only work for code bases that wish to 'opt in' and thus "=
have" to change their existing code (and/or live with warnings).
>=20
> Currently there is no mechanism to do even that.
>=20
> Also note that I explicitly specified that the meaning of existing code i=
s not changed. The point is to define a common mechanism to specify intent.
>=20
> The alternative is to ignore the problem or only solve it using compiler-=
specific markup.

Since implicit is always implicit, it can always be specified by lack of sp=
ecification. Fortunately, the preprocessor provides the user with the tools=
 to expressively specify nothing:

#define implicit // Implicit is the default, i.e. opposite of explicit keyw=
ord.

struct wrap_int {
    implicit wrap_int( int );

    implicit operator int();

    int value;
};

This is stylistically fine, completely portable, and easy to understand (gi=
ven a comment). It doesn't break anything except use of implicit as an iden=
tifier, which the proposal does too. (Users would be well advised to do thi=
s only after all third-party library #includes.)

The only disadvantages are inability to diagnose improper usage, which isn'=
t particularly important, and inconsistent syntax highlighting in text edit=
ors, which savvy users can often fix for themselves.

--=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/.

--Apple-Mail=_0F21165C-75C5-4D88-8F11-082EB40EA659
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html; charset=ISO-8859-1

<html><head><meta http-equiv=3D"Content-Type" content=3D"text/html charset=
=3Dus-ascii"></head><body style=3D"word-wrap: break-word; -webkit-nbsp-mode=
: space; -webkit-line-break: after-white-space;"><br><div><div>On Feb 11, 2=
014, at 1:08 AM, Matthew Woehlke &lt;<a href=3D"mailto:mw_triad@users.sourc=
eforge.net">mw_triad@users.sourceforge.net</a>&gt; wrote:</div><br class=3D=
"Apple-interchange-newline"><blockquote type=3D"cite">Yes, but that's the s=
ame problem as with e.g. implicit switch fallthrough. Some things can only =
work for code bases that wish to 'opt in' and thus "have" to change their e=
xisting code (and/or live with warnings).<br><br>Currently there is no mech=
anism to do even that.<br><br>Also note that I explicitly specified that th=
e meaning of existing code is not changed. The point is to define a common =
mechanism to specify intent.<br><br>The alternative is to ignore the proble=
m or only solve it using compiler-specific markup.<br></blockquote><div><br=
></div><div>Since <font face=3D"Courier">implicit</font> is always implicit=
, it can always be specified by lack of specification. Fortunately, the pre=
processor provides the user with the tools to expressively specify nothing:=
</div><div><br></div><div><font face=3D"Courier">#define implicit // Implic=
it is the default, i.e. opposite of explicit keyword.</font></div><div><fon=
t face=3D"Courier"><br></font></div><div><font face=3D"Courier">struct wrap=
_int {</font></div><div><font face=3D"Courier">&nbsp; &nbsp; implicit wrap_=
int( int );</font></div><div><font face=3D"Courier"><br></font></div><div><=
font face=3D"Courier">&nbsp; &nbsp; implicit operator int();</font></div><d=
iv><font face=3D"Courier"><br></font></div><div><font face=3D"Courier">&nbs=
p; &nbsp; int value;</font></div><div><font face=3D"Courier">};</font></div=
><div><br></div><div>This is stylistically fine, completely portable, and e=
asy to understand (given a comment). It doesn't break anything except use o=
f <font face=3D"Courier">implicit</font>&nbsp;as an identifier, which the p=
roposal does too. (Users would be well advised to do this only after all th=
ird-party library <font face=3D"Courier">#include</font>s.)</div><div><br><=
/div><div>The only disadvantages are inability to diagnose improper usage, =
which isn't particularly important, and inconsistent syntax highlighting in=
 text editors, which savvy users can often fix for themselves.</div><div><b=
r></div></div></body></html>

<p></p>

-- <br />
&nbsp;<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 std-proposals+unsubscribe@isocpp.org.<br />
To post to this group, send email to std-proposals@isocpp.org.<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 />

--Apple-Mail=_0F21165C-75C5-4D88-8F11-082EB40EA659--

.
