220 6151 <97c39adb-7f10-4bcc-a9c9-121356e2308c@isocpp.org> article
Path: news.gmane.org!not-for-mail
From: the.ultimate.koala@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 09:04:05 -0700 (PDT)
Lines: 134
Approved: news@gmane.org
Message-ID: <97c39adb-7f10-4bcc-a9c9-121356e2308c@isocpp.org>
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>
 <208850a5-5c8f-46c4-abe0-2a5aaea09dfd@isocpp.org>
 <200f023a-8cf5-4325-bf3e-e3d1f4fa30c7@isocpp.org>
 <f182ebcd-82ff-4967-b156-91382ed93b7a@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: multipart/alternative; 
	boundary="----=_Part_466_9070264.1378310645629"
X-Trace: ger.gmane.org 1378310647 3242 80.91.229.3 (4 Sep 2013 16:04:07 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Wed, 4 Sep 2013 16:04:07 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBDIODEPKWANBB5VTTWIQKGQEYDDCCCQ@isocpp.org Wed Sep 04 18:04:08 2013
Return-path: <std-proposals+bncBDIODEPKWANBB5VTTWIQKGQEYDDCCCQ@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-ve0-f199.google.com ([209.85.128.199])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBDIODEPKWANBB5VTTWIQKGQEYDDCCCQ@isocpp.org>)
	id 1VHFYt-0001Yp-Fj
	for gclcip-std-proposals@m.gmane.org; Wed, 04 Sep 2013 18:04:07 +0200
Original-Received: by mail-ve0-f199.google.com with SMTP id m1sf522551ves.6
        for <gclcip-std-proposals@m.gmane.org>; Wed, 04 Sep 2013 09:04:06 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20120113;
        h=date:from:to:message-id:in-reply-to:references:subject:mime-version
         :x-original-sender:reply-to:precedence:mailing-list:list-id
         :list-post:list-help:list-archive:list-subscribe:list-unsubscribe
         :content-type;
        bh=MCSB+hfC6Rhqt63z9GUhZjKa3/Brwa4Orknm73tZ3PM=;
        b=DorMRF4i/fED5kboxzOc3AT3vLOf9YhsQqQfiXIVTLxfO803d1QFIRO1pOfD4iWrsA
         vnYlTgfjbcszmkdfIGwGJ80Da4hGGpwLnV8AjCmIH64gc8Xaa7F4beqIxf1oUCADPTOA
         rirHsuFBhGkjEbUckCTWwPmeRdRky1uFZX2G+8G3fndpos/j6tjlSjPMHWgf2fpcRCcX
         Y/aXok/kvXuoPE681xzT6CK0BiW0mseFrglKdMhq9KRG5DrZsomEgSP3l/OKz+OijJ7Q
         IhhgalUpxyJq7PVYsYVi6xdbWAvn8rwXRGuK1S1zpJJUIf23UlNJ/eJ6n1EUlLfoYEi+
         MWBg==
X-Received: by 10.236.227.165 with SMTP id d35mr801984yhq.51.1378310646597;
        Wed, 04 Sep 2013 09:04:06 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.49.47.82 with SMTP id b18ls184424qen.53.gmail; Wed, 04 Sep
 2013 09:04:05 -0700 (PDT)
X-Received: by 10.49.3.134 with SMTP id c6mr154868qec.0.1378310645952;
        Wed, 04 Sep 2013 09:04:05 -0700 (PDT)
In-Reply-To: <f182ebcd-82ff-4967-b156-91382ed93b7a@isocpp.org>
X-Original-Sender: theultimatekoala@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:6151
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/6151>

------=_Part_466_9070264.1378310645629
Content-Type: text/plain; charset=ISO-8859-1



> Please no, dense and sparse have mathematical meanings completely 
> different from this. Rational numbers over a bignum type could sort-of be 
> called dense in the mathematical sense.
>

Yes, although I am not a mathematician, I know that mathematics have, to my 
dismay, assigned precise meaning to a huge part of the dictionary. I just 
found these better than OhNoItsPacked<T> and 
YessssssThereIsACornerThereFitItInFitItInQuick<T> :-)

If you agree with the idea, would you mind help me find better names?

>
>>    - The concepts Sparse<T> and Dense<T>,
>>
>> What's the point of complementary concepts? Define "Dense" as "not 
> Sparse."
>

Of course.

Implementation would also be complicated, with a need for enable_if as 
> Nicol mentioned.
>

Or Concepts Lite. (N3701) Sparse<T> and !Sparse<T> should cover a great 
deal of value semantics.

I'm getting ahead of myself, I know. I'm imagining what an ideal 
implementation of optional<T> would look like.

>
>>    - The ability to get the underlying_type of a type T, whether Sparse 
>>    or Dense,
>>    
>> Maybe I'm confused. What could the underlying type of a Dense type be, 
> besides itself?
>
>
enums and enum classes are Dense, but their underlying types are different.

Using the semantics of Sparse<T> and Dense<T> as outlined above, I'd say 
>> Dense<double> and Dense<float>, although I don't know if there are any 
>> values left free by IEEE754.
>>
> There are as many distinct NaNs as there are numbers between 0.5 and 1, 
> but it's a bad idea to try to distinguish them.
>
 
So can we create a C++ type that can store doubles that are non-NaN? What 
would be the interface of such a type?

-- 

--- 
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/.

------=_Part_466_9070264.1378310645629
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><br><blockquote class=3D"gmail_quote" style=3D"margin: 0;m=
argin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir=
=3D"ltr"><div>Please no, dense and sparse have mathematical meanings comple=
tely different from this. Rational numbers over a bignum type could sort-of=
 be called dense in the mathematical sense.<br></div></div></blockquote><di=
v><br>Yes, although I am not a mathematician, I know that mathematics have,=
 to my dismay, assigned precise meaning to a huge part of the dictionary. I=
 just found these better than OhNoItsPacked&lt;T&gt; and YessssssThereIsACo=
rnerThereFitItInFitItInQuick&lt;T&gt; :-)<br><br>If you agree with the idea=
, would you mind help me find better names?<br></div><blockquote class=3D"g=
mail_quote" style=3D"margin: 0;margin-left: 0.8ex;border-left: 1px #ccc sol=
id;padding-left: 1ex;"><div dir=3D"ltr"><div></div><blockquote class=3D"gma=
il_quote" style=3D"margin:0;margin-left:0.8ex;border-left:1px #ccc solid;pa=
dding-left:1ex"><div dir=3D"ltr"><div><ul><li>The concepts Sparse&lt;T&gt; =
and Dense&lt;T&gt;,</li></ul></div></div></blockquote><div>What's the point=
 of complementary concepts? Define "Dense" as "not Sparse."</div></div></bl=
ockquote><div><br>Of course.<br><br></div><blockquote class=3D"gmail_quote"=
 style=3D"margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-=
left: 1ex;"><div dir=3D"ltr"><div> Implementation would also be complicated=
, with a need for <span style=3D"font-family:courier new,monospace">enable_=
if</span> as Nicol mentioned.<br></div></div></blockquote><div><br>Or Conce=
pts Lite. (N3701) Sparse&lt;T&gt; and !Sparse&lt;T&gt; should cover a great=
 deal of value semantics.<br><br>I'm getting ahead of myself, I know. I'm i=
magining what an ideal implementation of <span style=3D"font-family: courie=
r new,monospace;">optional&lt;T&gt;</span> would look like.<br></div><block=
quote class=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.8ex;border-le=
ft: 1px #ccc solid;padding-left: 1ex;"><div dir=3D"ltr"><div></div><blockqu=
ote class=3D"gmail_quote" style=3D"margin:0;margin-left:0.8ex;border-left:1=
px #ccc solid;padding-left:1ex"><div dir=3D"ltr"><div><ul><li>The ability t=
o get the underlying_type of a type T, whether Sparse or Dense,<br></li></u=
l></div></div></blockquote><div>Maybe I'm confused. What could the underlyi=
ng type of a Dense type be, besides itself?<br><br></div></div></blockquote=
><div><br><span style=3D"font-family: courier new,monospace;">enum</span>s =
and <span style=3D"font-family: courier new,monospace;">enum class</span>es=
 are Dense, but their underlying types are different.<br><br></div><blockqu=
ote class=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.8ex;border-left=
: 1px #ccc solid;padding-left: 1ex;"><div dir=3D"ltr"><div></div><blockquot=
e class=3D"gmail_quote" style=3D"margin:0;margin-left:0.8ex;border-left:1px=
 #ccc solid;padding-left:1ex"><div dir=3D"ltr">Using the semantics of Spars=
e&lt;T&gt; and Dense&lt;T&gt; as outlined above, I'd say Dense&lt;double&gt=
; and Dense&lt;float&gt;, although I don't know if there are any values lef=
t free by IEEE754.<br></div></blockquote><div></div></div></blockquote><blo=
ckquote class=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.8ex;border-=
left: 1px #ccc solid;padding-left: 1ex;"><div dir=3D"ltr"><div>There are as=
 many distinct NaNs as there are numbers between 0.5 and 1, but it's a bad =
idea to try to distinguish them.<br></div></div></blockquote><div>&nbsp;<br=
>So can we create a C++ type that can store doubles that are non-NaN? What =
would be the interface of such a type?<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 />

------=_Part_466_9070264.1378310645629--

.
