220 30190 <2225413.PkzHcSPZVx@tjmaciei-mobl1> article
Path: news.gmane.org!.POSTED!not-for-mail
From: Thiago Macieira <thiago@macieira.org>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: enum_cast proposal
Date: Tue, 03 Jan 2017 17:09:14 -0200
Lines: 44
Approved: news@gmane.org
Message-ID: <2225413.PkzHcSPZVx@tjmaciei-mobl1>
References: <efdf2357-00a6-408a-8772-12f99135a880@isocpp.org> <2998762.etaySSRi7N@tjmaciei-mobl1> <85e681ea-20cb-5d87-d337-6b472e35eb11@wanadoo.fr>
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 1483470567 9731 195.159.176.226 (3 Jan 2017 19:09:27 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Tue, 3 Jan 2017 19:09:27 +0000 (UTC)
User-Agent: KMail/5.3.3 (Linux/4.8.13-1-default; KDE/5.28.0; x86_64; ; )
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBCB4TK757YBRBXXNV7BQKGQEOSSMBVA@isocpp.org Tue Jan 03 20:09:21 2017
Return-path: <std-proposals+bncBCB4TK757YBRBXXNV7BQKGQEOSSMBVA@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-lf0-f70.google.com ([209.85.215.70])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBCB4TK757YBRBXXNV7BQKGQEOSSMBVA@isocpp.org>)
	id 1cOUSR-0000zo-1c
	for gclcip-std-proposals@m.gmane.org; Tue, 03 Jan 2017 20:09:15 +0100
Original-Received: by mail-lf0-f70.google.com with SMTP id b14sf182776423lfg.6
        for <gclcip-std-proposals@m.gmane.org>; Tue, 03 Jan 2017 11:09:19 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=isocpp-org.20150623.gappssmtp.com; s=20150623;
        h=from:to:subject:date:message-id:user-agent:in-reply-to:references
         :mime-version: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=veoVAwpkY++PgE/aNo1udHch3fES91aZcj1Awysw8BI=;
        b=IZCy+KUWTccNZq+jKg+VpIu7U/Q9nhOPFgEfAUG4TlZTRUR1SRCAe0rNdWmqB6/8Cu
         ACTlLij/d0R8tzrcV9m2RclOaXtbJpXG3QHjNN5pgupxt+XdyWGeD21/tNtnjrgE4cYt
         MPdKCYFhPWX+PdzOs7UfhI7+76GVOovzcPeg9fNYa130+HCeAAdQdmrSjbVLQ4Pux9F0
         WpJ/D+0MvXuZewgeYSO9nnBRHWBIF9N7mJEbfswBBrBkiT3hqK7dceaq1vJdqsHWGUuv
         8SqujefJtdqFYgRt03wOSIYlkw9S/Z66Vhapr0GiqEVj45OOzXOUd3hEfXCvUB2PQCkA
      
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        h=x-gm-message-state:from:to:subject:date:message-id:user-agent
         :in-reply-to:references:mime-version: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=veoVAwpkY++PgE/aNo1udHch3fES91aZcj1Awysw8BI=;
        b=APyhxTvvPQsfMRaHFJnkeaprB4oB3mVKSnaadM97fL67ffHQXoKZ2SMOxMbWo2eW7S
         n3Eq/p+CeK1WW1Hx7rZTbGCpsYcbcB+PIQSAOIxf4a4S7DmV2YZnHu3T34LLdF8kuK0Z
         nHBBniT8ivKYF2zJ/6BwL8z5tU6qlNd8TYbC01FWWEbPVF01Ys7FSmLncvoTZhPGNsBf
         usuaEUbDi7uQ2PueGhdXevoNezY32BuNz9b/4MAOosBwZLz2NNASs1vzGkdmt+7uDBf4
         2XtMee2k+/g0wjB1AaBB57aDTbCjBawb8tWvWmx4CrJgAm4w5KYOocHEMiueFf+pi7Bl
  
X-Gm-Message-State: AIkVDXIA/zoKpIphHoZzs6meD2XIAjOD/1nP39Vrc5uBC6CWtJbKIOaS0xvCEo2XYs2J7Q==
X-Received: by 10.25.170.17 with SMTP id t17mr5310909lfe.20.1483470559451;
        Tue, 03 Jan 2017 11:09:19 -0800 (PST)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.28.143.203 with SMTP id r194ls5990100wmd.21.canary-gmail; Tue,
 03 Jan 2017 11:09:18 -0800 (PST)
X-Received: by 10.28.55.203 with SMTP id e194mr50868121wma.6.1483470558336;
        Tue, 03 Jan 2017 11:09:18 -0800 (PST)
Original-Received: from gondolin.macieira.info (gondolin.macieira.info. [78.47.120.188])
        by mx.google.com with ESMTP id 6si74514664wmq.165.2017.01.03.11.09.18
        for <std-proposals@isocpp.org>;
        Tue, 03 Jan 2017 11:09:18 -0800 (PST)
Received-SPF: pass (google.com: domain of thiago@macieira.org designates 78.47.120.188 as permitted sender) client-ip=78.47.120.188;
Original-Received: from tjmaciei-mobl1.localnet (unknown [187.34.234.250])
	by gondolin.macieira.info (Postfix) with ESMTPSA id ECB3E11B7FC
	for <std-proposals@isocpp.org>; Tue,  3 Jan 2017 11:09:16 -0800 (PST)
In-Reply-To: <85e681ea-20cb-5d87-d337-6b472e35eb11@wanadoo.fr>
X-Original-Sender: thiago@macieira.org
X-Original-Authentication-Results: mx.google.com;       spf=pass (google.com:
 domain of thiago@macieira.org designates 78.47.120.188 as permitted sender) smtp.mailfrom=thiago@macieira.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: <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:30190
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/30190>

On ter=C3=A7a-feira, 3 de janeiro de 2017 18:53:02 BRST Vicente J. Botet Es=
criba=20
wrote:
> Le 03/01/2017 =C3=A0 16:56, Thiago Macieira a =C3=A9crit :
> > On ter=C3=A7a-feira, 3 de janeiro de 2017 07:06:10 BRST m.cencora@gmail=
..com
> > wrote:
> >=20
> > Also, where did that optional come from? If it's going to use optional,
> > then it needs to be a library feature.
>=20
> I'm not for the optional return type, but we have already a lot of cases
> where syntactic sugar as range-based for loop and structure binding
> depends on library.
> So I'm not sure this could be an argument against optional.

Those are quite different things. In fact, they show how to *not* depend on=
=20
the library in the first place. Ranged fors and structured bindings only=20
require that functions called begin, end, and get exist. So I can add any=
=20
function of my own with those names and it will work. And structured bindin=
gs=20
are very specifically *not* a std::tuple. They're something different.

So enum_cast could return an optional-like opaque type defined by the compi=
ler=20
(like structured bindings and lambdas) which can be converted to std::optio=
nal=20
on construction.

--=20
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
   Software Architect - Intel Open Source Technology Center

--=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/2225413.PkzHcSPZVx%40tjmaciei-mobl1.

.
