220 30236 <8747ddc6-c416-44b9-a8a0-b3a00f835c05@isocpp.org> article
Path: news.gmane.org!.POSTED!not-for-mail
From: Nicol Bolas <jmckesson@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: enum_cast proposal
Date: Wed, 4 Jan 2017 08:33:28 -0800 (PST)
Lines: 117
Approved: news@gmane.org
Message-ID: <8747ddc6-c416-44b9-a8a0-b3a00f835c05@isocpp.org>
References: <efdf2357-00a6-408a-8772-12f99135a880@isocpp.org> <64617344.0Ggdhq6B90@tjmaciei-mobl1> <d03061cc-7442-4e10-9313-a3394afa11e3@isocpp.org>
 <10490049.adee8Rr8fZ@tjmaciei-mobl1>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_4063_1935462667.1483547608425"
X-Trace: blaine.gmane.org 1483547620 23403 195.159.176.226 (4 Jan 2017 16:33:40 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Wed, 4 Jan 2017 16:33:40 +0000 (UTC)
To: ISO C++ Standard - Future Proposals <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBCEKFTV6ZUMBBWOHWTBQKGQEG56SI2Y@isocpp.org Wed Jan 04 17:33:34 2017
Return-path: <std-proposals+bncBCEKFTV6ZUMBBWOHWTBQKGQEG56SI2Y@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-pg0-f72.google.com ([74.125.83.72])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBCEKFTV6ZUMBBWOHWTBQKGQEG56SI2Y@isocpp.org>)
	id 1cOoVB-0004Rq-TS
	for gclcip-std-proposals@m.gmane.org; Wed, 04 Jan 2017 17:33:26 +0100
Original-Received: by mail-pg0-f72.google.com with SMTP id 5sf907547065pgj.6
        for <gclcip-std-proposals@m.gmane.org>; Wed, 04 Jan 2017 08:33:30 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=isocpp-org.20150623.gappssmtp.com; s=20150623;
        h=date:from:to:message-id:in-reply-to:references:subject:mime-version
         :x-original-sender:reply-to:precedence:mailing-list:list-id
         :x-spam-checked-in-group:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe;
        bh=SYWRFNObTy0PDxD2hG3xS163HfcQvzNTqbpa53nulnI=;
        b=Lde8slAeLZYCt6FskphP+6Gczv4vp3SCGONWKkih5kHbyIg/RvyBlKvNKpo/ISEEWJ
         A4lq8cGBHZVZGJXUY1gyIIncpauFHJomJ8LE6Mod/GL8gvtSdNcHtYxR4fyanK6A5eZq
         +X2LOvG0gnbkKsxstfQcA8YpojK04cCW239Wmnh6vdEGEy3sjCGf/SQU9mcuJibgFlqJ
         ISeCgdjUbhe1NJN97YePjhDWfzSMfjQHQau9tQHL/m8g3mr/dFS3fZ1KqD2KJezebyyq
         K9m715Ql49XCKKsbRhCnuNEDnTIDUpenB4twpQq+Njhs+a4cRjC+XU0jG01L3ANxfgqh
         hOQQ==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20161025;
        h=date:from:to:message-id:in-reply-to:references:subject:mime-version
         :x-original-sender:reply-to:precedence:mailing-list:list-id
         :x-spam-checked-in-group:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe;
        bh=SYWRFNObTy0PDxD2hG3xS163HfcQvzNTqbpa53nulnI=;
        b=TVfl86Qz793km4XxNDTPMS71FMsFRRtJwfcc9Iqyh5neWfXx0SXf8sNsUXAonwHIjv
         RXpRtPvd3KQtwv5NlC4O1r4fk0ZLoTDcMVyCREB8bUyBaRbYCHCGFNZFjWMNaKVAHSBj
         ugVeZCxsL4jX/ZshYqiE82/BIdnwJx1OZD2Hiq7mPLuuuYlhZ/q2nAphKTFf8o1RWgU0
         x/PrjCux3ldjQc6sSSfna1AZKK+v8ODC7omSQ+WI81+JO9tXkA+sOWuXMUs33s7a63Mv
         j40vuXCFiWdHZhhOw3kXbCSLQY6tfxNFecKYmsZ45sW870asshTbNYQds1RLu8C0ZLvZ
         O4Qw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        h=x-gm-message-state:date:from:to:message-id:in-reply-to:references
         :subject:mime-version:x-original-sender:reply-to:precedence
         :mailing-list:list-id:x-spam-checked-in-group:list-post:list-help
         :list-archive:list-subscribe:list-unsubscribe;
        bh=SYWRFNObTy0PDxD2hG3xS163HfcQvzNTqbpa53nulnI=;
        b=EbvcS/QbX9kDAPilv2bsp9Mc8R5Eui48EudeXCxhLqsfsdT+5kaLqWgvvXcmdtlLG3
         6DAscBL5rL1nfiE+UT3snH5hTG61rTf91uyGsgh1/B9pbXb0neKgKViZhqEZdvvoxUZt
         NH93cMdxyYUG2GYnddxRqu08yl6ud3jIiIRPZn+dCA6VSXgTw0HhYH/L4sxOxLwkQ7Zq
         OqR6xlscVPPncI8ImGAMDYIHD67RZDRlXFYu2Fel/GZqubZ7IhwZf2KYvFh8cOcPM4Ov
         PBu/HK84hD2lwDA3nv31saJTsDFC/nZW/rFGL99N+HKYnFVLUawdoBtMF+/M0gHkIKyt
         1Asw==
X-Gm-Message-State: AIkVDXJUtJL5j8hX9X+P1tuY8hcJu8U5z2LQQ2kvJlLKYFUFetKHAx60GWsrXdkr12sVfg==
X-Received: by 10.99.9.1 with SMTP id 1mr38769568pgj.66.1483547609812;
        Wed, 04 Jan 2017 08:33:29 -0800 (PST)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.157.33.198 with SMTP id s64ls32347348otb.22.gmail; Wed, 04 Jan
 2017 08:33:29 -0800 (PST)
X-Received: by 10.157.42.16 with SMTP id t16mr2242716ota.18.1483547609035;
        Wed, 04 Jan 2017 08:33:29 -0800 (PST)
In-Reply-To: <10490049.adee8Rr8fZ@tjmaciei-mobl1>
X-Original-Sender: jmckesson@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:30236
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/30236>

------=_Part_4063_1935462667.1483547608425
Content-Type: multipart/alternative; 
	boundary="----=_Part_4064_689798405.1483547608425"

------=_Part_4064_689798405.1483547608425
Content-Type: text/plain; charset=UTF-8



On Wednesday, January 4, 2017 at 11:16:17 AM UTC-5, Thiago Macieira wrote:
>
> On quarta-feira, 4 de janeiro de 2017 07:20:11 BRST m.ce...@gmail.com 
> <javascript:> wrote: 
> > Why do you want to use some compiler invented type instead? 
> > If enum_cast is a function in standard library, why can't it use another 
> > type from same library? 
>
> Then it is a function in the standard library. That means it needs to be 
> based 
> on something else to perform the check, like reflection.
>

There are plenty of functions in the standard library whose implementations 
rely on compiler-specific features. You wouldn't be able to implement most 
of the type traits without compiler intrinsic or some compiler-specific 
knowledge. You can't implement `type_info` or `initializer_list` without 
the compiler being involved. And so forth.

This would simply be one more compiler-based construct. Once we get 
compile-time reflection, implementations could become platform-neutral 
(though the compiler-equivalent would probably still get faster).

But how the function gets implemented ultimately has nothing to do with 
having it return `std::optional`.
 

>
> -- 
> Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org 
>    Software Architect - Intel Open Source Technology Center 
>
>

-- 
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 email 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/8747ddc6-c416-44b9-a8a0-b3a00f835c05%40isocpp.org.

------=_Part_4064_689798405.1483547608425
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><br><br>On Wednesday, January 4, 2017 at 11:16:17 AM UTC-5=
, Thiago Macieira wrote:<blockquote class=3D"gmail_quote" style=3D"margin: =
0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;">On qua=
rta-feira, 4 de janeiro de 2017 07:20:11 BRST <a href=3D"javascript:" targe=
t=3D"_blank" gdf-obfuscated-mailto=3D"nmfexIHGCwAJ" rel=3D"nofollow" onmous=
edown=3D"this.href=3D&#39;javascript:&#39;;return true;" onclick=3D"this.hr=
ef=3D&#39;javascript:&#39;;return true;">m.ce...@gmail.com</a> wrote:
<br>&gt; Why do you want to use some compiler invented type instead?
<br>&gt; If enum_cast is a function in standard library, why can&#39;t it u=
se another
<br>&gt; type from same library?
<br>
<br>Then it is a function in the standard library. That means it needs to b=
e based=20
<br>on something else to perform the check, like reflection.<br></blockquot=
e><div><br>There are plenty of functions in the standard library whose impl=
ementations rely on compiler-specific features. You wouldn&#39;t be able to=
 implement most of the type traits without compiler intrinsic or some compi=
ler-specific knowledge. You can&#39;t implement `type_info` or `initializer=
_list` without the compiler being involved. And so forth.<br><br>This would=
 simply be one more compiler-based construct. Once we get compile-time refl=
ection, implementations could become platform-neutral (though the compiler-=
equivalent would probably still get faster).<br><br>But how the function ge=
ts implemented ultimately has nothing to do with having it return `std::opt=
ional`.<br>=C2=A0</div><blockquote class=3D"gmail_quote" style=3D"margin: 0=
;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;">
<br>--=20
<br>Thiago Macieira - thiago (AT) <a href=3D"http://macieira.info" target=
=3D"_blank" rel=3D"nofollow" onmousedown=3D"this.href=3D&#39;http://www.goo=
gle.com/url?q\x3dhttp%3A%2F%2Fmacieira.info\x26sa\x3dD\x26sntz\x3d1\x26usg\=
x3dAFQjCNEswDUBNCNanbu7euhqLn_62FW8ag&#39;;return true;" onclick=3D"this.hr=
ef=3D&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fmacieira.info\x26sa\x=
3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEswDUBNCNanbu7euhqLn_62FW8ag&#39;;return t=
rue;">macieira.info</a> - thiago (AT) <a href=3D"http://kde.org" target=3D"=
_blank" rel=3D"nofollow" onmousedown=3D"this.href=3D&#39;http://www.google.=
com/url?q\x3dhttp%3A%2F%2Fkde.org\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNH=
GRJdo5_JYG1DowztwAHAKs80XSA&#39;;return true;" onclick=3D"this.href=3D&#39;=
http://www.google.com/url?q\x3dhttp%3A%2F%2Fkde.org\x26sa\x3dD\x26sntz\x3d1=
\x26usg\x3dAFQjCNHGRJdo5_JYG1DowztwAHAKs80XSA&#39;;return true;">kde.org</a=
>
<br>=C2=A0 =C2=A0Software Architect - Intel Open Source Technology Center
<br>
<br></blockquote></div>

<p></p>

-- <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 <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/8747ddc6-c416-44b9-a8a0-b3a00f835c05%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/8747ddc6-c416-44b9-a8a0-b3a00f835c05=
%40isocpp.org</a>.<br />

------=_Part_4064_689798405.1483547608425--

------=_Part_4063_1935462667.1483547608425--

.
