220 6154 <CAFk2RUbo3BS+dZdeQ-GG=X6Vpg_QLFr1YUGC-DXf0OA0gAeiYA@mail.gmail.com> article
Path: news.gmane.org!not-for-mail
From: Ville Voutilainen <ville.voutilainen@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Re: std::degenerate<> class template :
 primitive/enum types with a special "undefined" value
Date: Wed, 4 Sep 2013 19:20:51 +0300
Lines: 109
Approved: news@gmane.org
Message-ID: <CAFk2RUbo3BS+dZdeQ-GG=X6Vpg_QLFr1YUGC-DXf0OA0gAeiYA@mail.gmail.com>
References: <18ab4801-260a-4228-8a7b-a71248b624e2@isocpp.org>
	<db1afcb0-7243-48f9-8b7b-fb0e9dbe99e6@isocpp.org>
	<77a1bdf8-1e0d-4294-b528-d08ba5403c98@isocpp.org>
	<023111c2-c983-407d-918f-39be42aa2949@isocpp.org>
	<cb3ab0e2-bea1-4741-997a-c3b3102cef7d@isocpp.org>
	<88ef15f1-6942-476e-b26c-6873ef6e6f0b@isocpp.org>
	<01900060-3aac-4645-a4a8-93b4e8760e42@isocpp.org>
	<5e63fe81-ab33-4bbb-ab4c-305f8b90140a@isocpp.org>
	<51a05a5a-ad56-4ffa-81d8-759953a93766@isocpp.org>
	<787f2f45-1fbc-4ce5-90fc-d8f0d8c2b8f4@isocpp.org>
	<6da8e8d3-7c26-4841-bc3f-40dd0715e92b@isocpp.org>
	<5226D6A4.4040707@wanadoo.fr>
	<90eb2850-ff75-47b6-979d-ac7400146b0b@isocpp.org>
	<52275A58.502@wanadoo.fr>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: multipart/alternative; boundary=089e0149ce365d134d04e5913017
X-Trace: ger.gmane.org 1378311649 16114 80.91.229.3 (4 Sep 2013 16:20:49 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Wed, 4 Sep 2013 16:20:49 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBC5JHI7A7ALRBY53TWIQKGQEOMEADKA@isocpp.org Wed Sep 04 18:20:53 2013
Return-path: <std-proposals+bncBC5JHI7A7ALRBY53TWIQKGQEOMEADKA@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-oa0-f72.google.com ([209.85.219.72])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBC5JHI7A7ALRBY53TWIQKGQEOMEADKA@isocpp.org>)
	id 1VHFp7-0000nQ-3t
	for gclcip-std-proposals@m.gmane.org; Wed, 04 Sep 2013 18:20:53 +0200
Original-Received: by mail-oa0-f72.google.com with SMTP id i4sf1924213oah.11
        for <gclcip-std-proposals@m.gmane.org>; Wed, 04 Sep 2013 09:20:52 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=mime-version:in-reply-to:references:date:message-id:subject:from: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;
        bh=rnmeNi4pexYIk/ch5QC/+qDsLU+86CwxWI3dY3e7woo=;
        b=grUf00w5QS45WIxr2tnxDlr0/gvPG562wQyu8nhmTVpO8c0bdT5idQoaG49I4sOsL9
         ftItoCGOtvx4VVr6enPW6yXLZYWRrjwlRwUOBEm1RflKkhk6w34N1VF1ct+F3JaeKOL/
         47/m3UAdQc9LXpfYeLtx4KnNhPa0SG15Disi0nsqc2Ld238DG7DZcORYpIz9I5P9LYvD
         25vKCG6am9haqvUFq0zTbX84TnDaR8hGdVsw+MLMmzTHZNkMX684fidJ9c8aH8Dy8E1J
         agSl5cCGvJQSN4D0L08q7sXiV0nt8S2b2n2n3vnM/tGOy3UPZJ6Bj2qnK3zndrEVNzGz
         CTvQ==
X-Received: by 10.182.205.138 with SMTP id lg10mr658402obc.33.1378311652025;
        Wed, 04 Sep 2013 09:20:52 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.182.236.232 with SMTP id ux8ls43164obc.73.gmail; Wed, 04 Sep
 2013 09:20:51 -0700 (PDT)
X-Received: by 10.182.88.202 with SMTP id bi10mr2757591obb.91.1378311651469;
        Wed, 04 Sep 2013 09:20:51 -0700 (PDT)
Original-Received: from mail-oa0-x236.google.com (mail-oa0-x236.google.com [2607:f8b0:4003:c02::236])
        by mx.google.com with ESMTPS id tk5si12643324oeb.145.1969.12.31.16.00.00
        (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128);
        Wed, 04 Sep 2013 09:20:51 -0700 (PDT)
Received-SPF: pass (google.com: domain of ville.voutilainen@gmail.com designates 2607:f8b0:4003:c02::236 as permitted sender) client-ip=2607:f8b0:4003:c02::236;
Original-Received: by mail-oa0-f54.google.com with SMTP id j10so719697oah.27
        for <std-proposals@isocpp.org>; Wed, 04 Sep 2013 09:20:51 -0700 (PDT)
X-Received: by 10.60.45.102 with SMTP id l6mr2778852oem.36.1378311651265; Wed,
 04 Sep 2013 09:20:51 -0700 (PDT)
Original-Received: by 10.76.176.1 with HTTP; Wed, 4 Sep 2013 09:20:51 -0700 (PDT)
In-Reply-To: <52275A58.502@wanadoo.fr>
X-Original-Sender: ville.voutilainen@gmail.com
X-Original-Authentication-Results: mx.google.com;       spf=pass (google.com:
 domain of ville.voutilainen@gmail.com designates 2607:f8b0:4003:c02::236 as
 permitted sender) smtp.mail=ville.voutilainen@gmail.com;       dkim=pass
 header.i=@gmail.com;       dmarc=pass (p=NONE dis=NONE) d=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: <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:6154
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/6154>

--089e0149ce365d134d04e5913017
Content-Type: text/plain; charset=ISO-8859-1

On 4 September 2013 19:05, Vicente J. Botet Escriba <
vicente.botet@wanadoo.fr> wrote:

> In this way optional doesn't changes its interface (preserv only one
> template parameter), and we are able to have
>
>
>> optional<T>
>>
>> and
>>
>> optional<degenerate<Player, integral_constant<Player, Player(-1)>>
>>
>
> That seems way too much like a kludge. Sure, you can `template using=`
> your way around it, but we shouldn't *have* to do things like that just
> to make something useable. What is so wrong with just making `optional<T,
> Tester>` as a variation? We do something similar for `unique_ptr`.
>
>   There is nothing wrong. Just this must be done quickly as once in C++14
> it would be not so easy to change the std::optional interface. My
> suggestion could be adopted just after c++14 is released.
>
>
>
Perhaps we should leave optional well alone and consider something like
http://rk.hekko.pl/constrained_value/
as a potential solution for cases where you want a type is a constrained
value rather than a nullable
proxy.

-- 

--- 
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.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.

--089e0149ce365d134d04e5913017
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><br><div class=3D"gmail_extra"><br><br><div class=3D"gmail=
_quote">On 4 September 2013 19:05, Vicente J. Botet Escriba <span dir=3D"lt=
r">&lt;<a href=3D"mailto:vicente.botet@wanadoo.fr" target=3D"_blank">vicent=
e.botet@wanadoo.fr</a>&gt;</span> wrote:<br>
<blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-=
left:1px solid rgb(204,204,204);padding-left:1ex">
 =20
   =20
 =20
  <div bgcolor=3D"#FFFFFF" text=3D"#000000">In this way optional doesn&#39;=
t changes its interface (preserv
            only one template parameter), and we are able to have <br><div =
class=3D"im"><blockquote type=3D"cite"><div dir=3D"ltr"><blockquote class=
=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rg=
b(204,204,204);padding-left:1ex">
<div bgcolor=3D"#FFFFFF" text=3D"#000000">
            <br>
            optional&lt;T&gt;<br>
            <br>
            and<br>
            <br>
            optional&lt;degenerate&lt;Player,
            integral_constant&lt;Player, Player(-1)&gt;&gt;<br>
          </div>
        </blockquote>
        <div><br>
          That seems way too much like a kludge. Sure, you can `template
          using=3D` your way around it, but we shouldn&#39;t <i>have</i> to
          do things like that just to make something useable. What is so
          wrong with just making `optional&lt;T, Tester&gt;` as a
          variation? We do something similar for `unique_ptr`.<br>
          <br>
        </div>
      </div>
    </blockquote></div>
    There is nothing wrong. Just this must be done quickly as once in
    C++14 it would be not so easy to change the std::optional interface.
    My suggestion could be adopted just after c++14 is released.<span class=
=3D""><font color=3D"#888888"><br>
    <br><br></font></span></div></blockquote><div><br></div><div>Perhaps we=
 should leave optional well alone and consider something like <a href=3D"ht=
tp://rk.hekko.pl/constrained_value/">http://rk.hekko.pl/constrained_value/<=
/a><br>
</div><div>as a potential solution for cases where you want a type is a con=
strained value rather than a nullable<br></div><div>proxy. <br></div></div>=
<br></div></div>

<p></p>

-- <br />
&nbsp;<br />
--- <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 std-proposals+unsubscribe@isocpp.org.<br />
To post to this group, send email to std-proposals@isocpp.org.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

--089e0149ce365d134d04e5913017--

.
