220 30203 <6951935.9LYeBEmE6C@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 21:14:56 -0200
Lines: 36
Approved: news@gmane.org
Message-ID: <6951935.9LYeBEmE6C@tjmaciei-mobl1>
References: <efdf2357-00a6-408a-8772-12f99135a880@isocpp.org> <2225413.PkzHcSPZVx@tjmaciei-mobl1> <7d89ec43-c691-44d8-bcb5-74dcda9eb493@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 1483485313 24529 195.159.176.226 (3 Jan 2017 23:15:13 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Tue, 3 Jan 2017 23:15:13 +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+bncBCB4TK757YBRB5PAWDBQKGQEQF7BYTY@isocpp.org Wed Jan 04 00:15:03 2017
Return-path: <std-proposals+bncBCB4TK757YBRB5PAWDBQKGQEQF7BYTY@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+bncBCB4TK757YBRB5PAWDBQKGQEQF7BYTY@isocpp.org>)
	id 1cOYID-0004Vs-P2
	for gclcip-std-proposals@m.gmane.org; Wed, 04 Jan 2017 00:14:57 +0100
Original-Received: by mail-lf0-f70.google.com with SMTP id l68sf185060477lfb.1
        for <gclcip-std-proposals@m.gmane.org>; Tue, 03 Jan 2017 15:15:01 -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=4VOCZBsnSmMeZ+p2kQg6DlpCTeSTgoc5kxh4K6z9u68=;
        b=uXNzP6uHNsgtNyjV3MVYRwJbQXWSAvwBZEHgA85jGE5LbaPPs7XE1C5eTNP60jO7AK
         lnGVvs16x1Z0mvl5SF0YpReVYpLBYU9hHgIRmxxXbzxc9qIoRMoVHW7lfHpIP8eFs/Y3
         JlNFWknEGNgjdLb6/Iu+pFoaNEEljENuFYgtJpQqD9lYn0F7hTrVWEOULH5EMXoZ2hZ/
         s2VkdfeTZzdvJsqvgmkYoE4+5+cCCKV530XGRNnk3MrH7Lpri47DnzrtKvYJha2OtLM8
         b/swOJRcZhM4X/hpgKQmhdxr3WArcz0B4R+zdFds/2F7C2VANdaK17/sPCoTKc/JVlAk
      
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=4VOCZBsnSmMeZ+p2kQg6DlpCTeSTgoc5kxh4K6z9u68=;
        b=ZCo0cC8nPJAk7+m3L5mTA/da6lm794OQAGTCJagIBwN0U3UyFDiFH3LXhunefZt+oR
         GM0qviRYLV89FTk6qDWtZfudVIaZ2IJ0irvBAma8Go2y7X6w6RnKDlmWBo49inWlIhJh
         gFVfbbkKWruhbA0Epyts3qVyJ2pxoCs4wRuwNkAN47S8js8EpAsM5VnTpUBjig9ZY+Xn
         cmkBsm0wo8zQ8j8/Wz6Zh7ZphyRUxOSddwl/jPUKVXrtwmJr+FurK6MZ/C94kmrfOp24
         w9jFWVPMUbEtwy5ADLyhtj6o8zHG3fbmk8F/8lVRuk2qRMdQwErGuIVCnEKhUqSgQtGp
  
X-Gm-Message-State: AIkVDXIrOKTlcTfVJy39HU2SDdWWU/7GQfF41ghCBT8wPztXwkYR3grdmjZpZWjDhNQEmQ==
X-Received: by 10.25.89.83 with SMTP id n80mr2367514lfb.0.1483485301738;
        Tue, 03 Jan 2017 15:15:01 -0800 (PST)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.28.93.209 with SMTP id r200ls3746355wmb.16.canary-gmail; Tue,
 03 Jan 2017 15:15:00 -0800 (PST)
X-Received: by 10.28.46.144 with SMTP id u138mr50984566wmu.136.1483485300814;
        Tue, 03 Jan 2017 15:15:00 -0800 (PST)
Original-Received: from gondolin.macieira.info (gondolin.macieira.info. [2a01:4f8:d13:f81:21c:14ff:fe01:12a3])
        by mx.google.com with ESMTP id y4si79021267wjc.180.2017.01.03.15.15.00
        for <std-proposals@isocpp.org>;
        Tue, 03 Jan 2017 15:15:00 -0800 (PST)
Received-SPF: pass (google.com: domain of thiago@macieira.org designates 2a01:4f8:d13:f81:21c:14ff:fe01:12a3 as permitted sender) client-ip=2a01:4f8:d13:f81:21c:14ff:fe01:12a3;
Original-Received: from tjmaciei-mobl1.localnet (unknown [187.34.234.250])
	by gondolin.macieira.info (Postfix) with ESMTPSA id D978711B804
	for <std-proposals@isocpp.org>; Tue,  3 Jan 2017 15:14:58 -0800 (PST)
In-Reply-To: <7d89ec43-c691-44d8-bcb5-74dcda9eb493@isocpp.org>
X-Original-Sender: thiago@macieira.org
X-Original-Authentication-Results: mx.google.com;       spf=pass (google.com:
 domain of thiago@macieira.org designates 2a01:4f8:d13:f81:21c:14ff:fe01:12a3
 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:30203
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/30203>

On ter=C3=A7a-feira, 3 de janeiro de 2017 11:59:46 BRST Nicol Bolas wrote:
> Lastly, having `enum_cast` work via some compiler-defined type is rather
> extreme for something as simplistic as this, don't you think? There are
> only so many ways to implement an "optional", and you can define implicit
> conversions from `std::optional` type to yours with little penalty. The
> conversion can even be `constexpr`, just like `std::optional`, so you wou=
ld
> suffer no loss of performance in constexpr contexts.

Anything that is a compiler feature (a builtin or a core language expressio=
n)=20
needs to be able to choose between std::optional, std::experimental::option=
al=20
and std::__1::optional by just changing #includes.

A library solution needs not.

It seems to me that a library solution wrapping a compiler builtin intrinsi=
c=20
is the only solution possible. And using reflection actually matches that=
=20
requirement, albeit indirectly.

--=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/6951935.9LYeBEmE6C%40tjmaciei-mobl1.

.
