220 32201 <b2a4b389-936c-4e2a-845a-ddccca84262c@isocpp.org> article
Path: news.gmane.org!.POSTED!not-for-mail
From: David Peterson <djpeterson83@hotmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Idea: New Language Feature for Safer, Easier
 Optional Access
Date: Thu, 27 Apr 2017 09:54:51 -0700 (PDT)
Lines: 65
Approved: news@gmane.org
Message-ID: <b2a4b389-936c-4e2a-845a-ddccca84262c@isocpp.org>
References: <bacbf6b9-06a8-4f30-b8f0-74a85a875191@isocpp.org>
 <921cd9f6-f26b-c674-6609-d924cf7d2758@wanadoo.fr>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_3791_325996676.1493312092026"
X-Trace: blaine.gmane.org 1493312092 5981 195.159.176.226 (27 Apr 2017 16:54:52 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Thu, 27 Apr 2017 16:54:52 +0000 (UTC)
To: ISO C++ Standard - Future Proposals <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBC2O5JM7VUCBBXGERDEAKGQEAJYDUAA@isocpp.org Thu Apr 27 18:54:49 2017
Return-path: <std-proposals+bncBC2O5JM7VUCBBXGERDEAKGQEAJYDUAA@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-pf0-f200.google.com ([209.85.192.200])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBC2O5JM7VUCBBXGERDEAKGQEAJYDUAA@isocpp.org>)
	id 1d3mgp-0001SB-U0
	for gclcip-std-proposals@m.gmane.org; Thu, 27 Apr 2017 18:54:48 +0200
Original-Received: by mail-pf0-f200.google.com with SMTP id a188sf30619435pfa.3
        for <gclcip-std-proposals@m.gmane.org>; Thu, 27 Apr 2017 09:54:54 -0700 (PDT)
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=Aj95gjvsJugqIDm5XsfmYXIJGYsLA+T/zf6bynXw9Us=;
        b=1QfoCbZ5woL7Dg42ED6YIOtz8yjxLORZEv5FYcakUCqtO6EkM3GS5p25dDOocg4Pkp
         cOkwHzp4/riGz6URqK16xld3iZW7tAdPMbqYwgqnbB+VPKzVI22kmPKx+mhMtR4fo7U1
         nZxIgF5OJov5T0Pa65L0zkS2MEPOIiKvJvFjXiJPH7M+islL2ktTKZuboz/im3qbUpK5
         +LeD6FQC7eRodyg7OdsTs94DEDCOPPs2lWvfQDNZbfbj7vsIH07ubGxBKFO04U4rGGax
         1Yo2uMQYeWuMztL/JNrTo5zOME92Jwn9ZdyVQPEQNFc+7OEGS8izfExf2S1Ms/DiprE3
         qauA==
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=Aj95gjvsJugqIDm5XsfmYXIJGYsLA+T/zf6bynXw9Us=;
        b=hVA98w7D1ftI0dDYmE5wnjAIYvAvL0yrowiWjQp22ZDiYU97ad4O0oqWQf0vWXs1Ra
         huwBmbpuyT7FLEwzpZkVQlTUjQiknsDTJnoufq1je/+cC/0VPgyXv6CbQMa18iMNsXGo
         fvLp5M57JMIQNPivWK+bIV038/vX2df0DPjmDxblIZP1mS9W2Q6M+iaJeY7SQ3WNNxna
         Igi4yJxirMYNLpAxB9gNLK+dK7vyGRA1wva77QCK7jEf3iIRY3BE5UE1p8mFTH3bJqSz
         f+/yn5Ip9/oGuVME7cX8bJp+MHWKqAgZRuqy1zIN7S8K3as6LNFcgYiaUoEVAVjcbv6F
         MBvg==
X-Gm-Message-State: AN3rC/4RWh2eQoaLEJ8Zr/ciZrG7c/AVSwBg9FKe6A/1eaj0G1E8wxD4
	tGE0sWeFaxHCew==
X-Received: by 10.99.167.13 with SMTP id d13mr2998532pgf.82.1493312093481;
        Thu, 27 Apr 2017 09:54:53 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.157.37.235 with SMTP id q98ls3978258ota.49.gmail; Thu, 27 Apr
 2017 09:54:52 -0700 (PDT)
X-Received: by 10.157.8.17 with SMTP id 17mr143446oty.20.1493312092562;
        Thu, 27 Apr 2017 09:54:52 -0700 (PDT)
In-Reply-To: <921cd9f6-f26b-c674-6609-d924cf7d2758@wanadoo.fr>
X-Original-Sender: djpeterson83@hotmail.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:32201
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/32201>

------=_Part_3791_325996676.1493312092026
Content-Type: multipart/alternative; 
	boundary="----=_Part_3792_2099221978.1493312092026"

------=_Part_3792_2099221978.1493312092026
Content-Type: text/plain; charset=UTF-8


>
> The language based variant proposal [1] (I hope will be part of C++20) 
> will allow to do pattern matching.I believe this will be more adapted and 
> will take in account std::expected as well.

 
This looks similar to Rust's enumeration and pattern matching.  In all 
honesty, I think I would prefer this pattern matching system to a built in 
optional.  This seems extremely flexible and could be used for run-time 
validation as well (such as a variant which is either a SuccessObject or a 
FailureObject after a process completes).  I hope that templating is 
included when (if?) the proposal is ratified as this would easily solve the 
issue with optionals in a very safe, easy to use way.

-- 
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/b2a4b389-936c-4e2a-845a-ddccca84262c%40isocpp.org.

------=_Part_3792_2099221978.1493312092026
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><blockquote class=3D"gmail_quote" style=3D"margin: 0px 0px=
 0px 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">=
The language based variant proposal [1] (I hope will be part of C++20) will=
 allow to do pattern matching.I believe this will be more adapted and will =
take in account std::expected as well.</blockquote><div>=C2=A0</div><div>Th=
is looks similar to Rust&#39;s enumeration and pattern matching. =C2=A0In a=
ll honesty, I think I would prefer this pattern matching system to a built =
in optional. =C2=A0This seems extremely flexible and could be used for run-=
time validation as well (such as a variant which is either a SuccessObject =
or a FailureObject after a process completes). =C2=A0I hope that templating=
 is included when (if?) the proposal is ratified as this would easily solve=
 the issue with optionals in a very safe, easy to use way.</div></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/b2a4b389-936c-4e2a-845a-ddccca84262c%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/b2a4b389-936c-4e2a-845a-ddccca84262c=
%40isocpp.org</a>.<br />

------=_Part_3792_2099221978.1493312092026--

------=_Part_3791_325996676.1493312092026--

.
