220 9274 <lddkst$6qs$1@ger.gmane.org> article
Path: news.gmane.org!not-for-mail
From: Matthew Woehlke <mw_triad@users.sourceforge.net>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: add "implicit" keyword?
Date: Tue, 11 Feb 2014 11:59:21 -0500
Lines: 67
Approved: news@gmane.org
Message-ID: <lddkst$6qs$1@ger.gmane.org>
References: <ldauqr$63v$1@ger.gmane.org> <ldb114$13r$1@ger.gmane.org> <E35FEFAC-824A-4048-8304-754825C0D27E@gmail.com> <1576598.9cS7S6zRmC@tjmaciei-mobl4>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: quoted-printable
X-Trace: ger.gmane.org 1392137971 7221 80.91.229.3 (11 Feb 2014 16:59:31 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Tue, 11 Feb 2014 16:59:31 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBCO5FYHBU4ERB55N5GLQKGQELTPTNRA@isocpp.org Tue Feb 11 17:59:39 2014
Return-path: <std-proposals+bncBCO5FYHBU4ERB55N5GLQKGQELTPTNRA@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-wi0-f198.google.com ([209.85.212.198])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBCO5FYHBU4ERB55N5GLQKGQELTPTNRA@isocpp.org>)
	id 1WDGgK-0007Kd-9l
	for gclcip-std-proposals@m.gmane.org; Tue, 11 Feb 2014 17:59:36 +0100
Original-Received: by mail-wi0-f198.google.com with SMTP id cc10sf10227260wib.1
        for <gclcip-std-proposals@m.gmane.org>; Tue, 11 Feb 2014 08:59:36 -0800 (PST)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:to:from:subject:date:lines:message-id:references
         :mime-version:user-agent: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:content-transfer-encoding;
        bh=XI8aUjtHFbULjXabZxG7nRTzomYSXdZpm7d6TrsYdxM=;
        b=YzsMivZYklLAEvqUWz0mIxdVcXSFpu21MaiqidsT9qov5qqR3AYiNYhKmInFZ5mSut
         bcYOpFt2aQa6rFEdemy38+HxTFuWSQppK/L/mPQmDEh28anyhnzPLdHaKppegAbWw6S+
         OoFqPjFNZ3iZnQ1j3TkGiXWpiB76Tt5wxdT1gvJywaLv8WrnyjLj2WwyJH7NxNLQGXH9
         SY8d6yKOoVGVI7qvM6vD8rvJEi5ug8gFHRPPNiDaKuJc9Yl6xmmzAnjY/RkufgnfbeNF
         My53wPdMzYXSBdRfsK8SIObBzq1QvSwb6WxC8iOsY/UF6nSx2qGjyTaI97gwf9tZ0/KA
       
X-Gm-Message-State: ALoCoQkQcUDqG8Oi8U6FgY2Xlic7FdYq+lN8Hd+qBNlUmevTTFifm4StvS8/x8a6MzyHYMQnie6V
X-Received: by 10.112.29.114 with SMTP id j18mr251505lbh.23.1392137975826;
        Tue, 11 Feb 2014 08:59:35 -0800 (PST)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.152.9.199 with SMTP id c7ls357347lab.104.gmail; Tue, 11 Feb
 2014 08:59:35 -0800 (PST)
X-Received: by 10.112.205.5 with SMTP id lc5mr2445647lbc.40.1392137974980;
        Tue, 11 Feb 2014 08:59:34 -0800 (PST)
Original-Received: from plane.gmane.org (plane.gmane.org. [80.91.229.3])
        by mx.google.com with ESMTPS id y6si10347163lal.166.2014.02.11.08.59.34
        for <std-proposals@isocpp.org>
        (version=TLSv1 cipher=RC4-SHA bits=128/128);
        Tue, 11 Feb 2014 08:59:34 -0800 (PST)
Received-SPF: pass (google.com: domain of gclcip-std-proposals@m.gmane.org designates 80.91.229.3 as permitted sender) client-ip=80.91.229.3;
Original-Received: from list by plane.gmane.org with local (Exim 4.69)
	(envelope-from <gclcip-std-proposals@m.gmane.org>)
	id 1WDGgI-0007Ib-8r
	for std-proposals@isocpp.org; Tue, 11 Feb 2014 17:59:34 +0100
Original-Received: from tripoint.kitware.com ([66.194.253.20])
        by main.gmane.org with esmtp (Gmexim 0.1 (Debian))
        id 1AlnuQ-0007hv-00
        for <std-proposals@isocpp.org>; Tue, 11 Feb 2014 17:59:34 +0100
Original-Received: from mw_triad by tripoint.kitware.com with local (Gmexim 0.1 (Debian))
        id 1AlnuQ-0007hv-00
        for <std-proposals@isocpp.org>; Tue, 11 Feb 2014 17:59:34 +0100
X-Injected-Via-Gmane: http://gmane.org/
Original-Lines: 49
Original-X-Complaints-To: usenet@ger.gmane.org
X-Gmane-NNTP-Posting-Host: tripoint.kitware.com
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0
In-Reply-To: <1576598.9cS7S6zRmC@tjmaciei-mobl4>
X-Original-Sender: mw_triad@users.sourceforge.net
X-Original-Authentication-Results: mx.google.com;       spf=pass (google.com:
 domain of gclcip-std-proposals@m.gmane.org designates 80.91.229.3 as
 permitted sender) smtp.mail=gclcip-std-proposals@m.gmane.org
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:9274
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/9274>

On 2014-02-11 02:34, Thiago Macieira wrote:
> Em ter 11 fev 2014, =C3=A0s 14:19:09, David Krauss escreveu:
>> This is stylistically fine, completely portable, and easy to understand
>> (given a comment). It doesn't break anything except use of implicit as a=
n
>> identifier, which the proposal does too. (Users would be well advised to=
 do
>> this only after all third-party library #includes.)
>
> The proposal was for a context-dependent keyword. It would not break uses=
 of
> "implicit" as an identifier elsewhere.
>
> Question: if it's context-dependent, would it be allowed only to the righ=
t of
> the parameter list?

No. In fact (like 'explicit') it would not be allowed to the right; see=20
original mail for the parse rules.

Examples:

class Foo
{
   implicit Foo(int); // okay
   explicit Foo(float); // okay
   Foo(short) implicit; // error, expected ';' after declaration
   Foo(double) explicit; // error, expected ';' after declaration
   implicit operator int(); // okay
   implicit operator+(int); // error, 'implicit' does not name a type
};
int implicit; // okay, declared an int variable named "implicit"

using implicit =3D int;
class Bar
{
   implicit operator+(int); // okay (but ugly), return type is int
   int operator-(implicit); // okay (but ugly), takes an int
};

> It might not be, since only constructors and cast operators can be implic=
it
> and those cannot have return types, so the presence of the keyword there =
would
> not be ambiguous. It might just be ugly:
>
> struct implicit {
> 	implicit implicit(int);
> 	explicit implicit(long);
> };

Eew. Yes, that's ugly :-). But would be allowed.

--=20
Matthew

--=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/.

.
