220 26180 <aa7736b2-9a2a-4b52-84ee-790e8548572f@isocpp.org> article
Path: news.gmane.org!not-for-mail
From: alexander.zywicki@gmail.com
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Any interest to adding audio support to the std library?
Date: Sat, 4 Jun 2016 08:01:53 -0700 (PDT)
Lines: 102
Approved: news@gmane.org
Message-ID: <aa7736b2-9a2a-4b52-84ee-790e8548572f@isocpp.org>
References: <5751B06A.4080501@mail1.stofanet.dk> <5290948.va25uYNizX@tjmaciei-mobl1>
 <CAEhD+6Ca=j3SaS5nC_Qe=6FGMdJLgpQd1LnGfiep8m9GrEU1jQ@mail.gmail.com>
 <1580229.cHEgQxCuA1@tjmaciei-mobl1> <CANh-dX=heKaWzvE+rk8FeCSTQyZ8-FR9UaGdam8quLaEuLJ=-A@mail.gmail.com>
 <62b7649a-5de5-4330-9bac-708375d36e2c@isocpp.org>
 <CAOcFa=fnWS=T2p6xgQ_EiCnVTmkSk_UrobDMYvXhaKi95cxrdQ@mail.gmail.com>
 <3c0fde91-671d-4751-955d-7b04cfa120bc@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_337_1705757657.1465052514079"
X-Trace: ger.gmane.org 1465052522 16658 80.91.229.3 (4 Jun 2016 15:02:02 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Sat, 4 Jun 2016 15:02:02 +0000 (UTC)
Cc: alexander.zywicki@gmail.com
To: ISO C++ Standard - Future Proposals <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBCS7TY6DTQOBBY62ZO5AKGQEWFLUZVI@isocpp.org Sat Jun 04 17:01:58 2016
Return-path: <std-proposals+bncBCS7TY6DTQOBBY62ZO5AKGQEWFLUZVI@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-yw0-f199.google.com ([209.85.161.199])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBCS7TY6DTQOBBY62ZO5AKGQEWFLUZVI@isocpp.org>)
	id 1b9D5I-0001dl-W0
	for gclcip-std-proposals@m.gmane.org; Sat, 04 Jun 2016 17:01:57 +0200
Original-Received: by mail-yw0-f199.google.com with SMTP id y6sf291888928ywe.0
        for <gclcip-std-proposals@m.gmane.org>; Sat, 04 Jun 2016 08:01:56 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=isocpp-org.20150623.gappssmtp.com; s=20150623;
        h=date:from:to:cc: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=xh4ejOPDVxHSnEoiU/jDe2lbjBGG/GQnVP1340iJWEg=;
        b=xGxGaHFAZQjPc7Omb5sLANheDtodvPo9JN9v195UJNyKyE9sibyEdZ3gMqE0OnDdCz
         q2v++3+YOLb4vJjHB2bawZ2GgvQxEK0vjPm2tUyKVlig4983UaT670LNxhyukgI4tBEy
         sQF8L4XBTcg5BjySe9Hlaj3+T+vk4XXfFeGpqnSk/zr7XsWtoDoAXFsuu/tm9YLKUona
         YKp2N8QiCaDNyvb7aETbYzYNU2ExKzFltGcC57T99wwn3Vkf0uswo3gfGZqs8oD0X0CS
         KMIaRYqUEuQHQTYQJiGNdlIga2ErCtceDYUiER+pSNiRadkncR4WarSKTv1nd6RGL/5C
         niHw==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20120113;
        h=date:from:to:cc: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=xh4ejOPDVxHSnEoiU/jDe2lbjBGG/GQnVP1340iJWEg=;
        b=r+r4QkR7gA2PHBnMUhGwbOPqeJ1VtBC2+pX0T9T2DzJiQOoRf0KNY/cs9unRBnhOeD
         FRn8kzsc3BTi/BEQfMXieU59jVXGUwKnEEctesCBwkPnmQNSHLoTCGiEatMaMpgwL0zq
         IDXtuMkE1XfQhgGe4kyX3qQc+2NkN+E3Xa3jdwvye9euATmQGU+v4zmLLBlOcNRfcj5A
         703L5DNM9vK3G37O9VnG+nD9O7nwS4cFjKpuDt0J0doHDa2k9ROf1NyJODc1EWOYhJ1I
         ZlBzbphRLAqUJn25m5lxCiPGDwC1sYxSu2dpU+Lkzx7LLS9ya6OIn4pVs0d2Rs+vKI2n
         JXBQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:date:from:to:cc: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=xh4ejOPDVxHSnEoiU/jDe2lbjBGG/GQnVP1340iJWEg=;
        b=c8HEW172t3muB/+KJG5W/vU/qIP2npvmSxZfz/HRKfu5ofTcmNEoxJQpZ3wtyGwrwR
         +DkW2Ww5MYVhCZ945MlEcXjgQDhhoIpduYUkYW+veDDcFynPvZFCupcIxJ1ReDlRXp8h
         AxaNST5aZH2jNH80oGkMEsxHwWb8AzBcxM7wzHu7XaAAXGIxgTy+CLlfR3NIdmlqcLoz
         kGVucslrqqKEblN0kAraj50MFO29B18WC1cZz0w3dhLblJl2NHIKByg+8jqPssGziJTq
         oF33xwbfQEWspyGM6Dy3IBnnWAPbygZiq+8VwTS8MfoiA44aVLOiRtRqJJ5aGun90GFh
         /UCw==
X-Gm-Message-State: ALyK8tJwecUYlpQgi3+fv0/GYAwcqZsIKThx829PWv7FH0SZRPANKuJHUoHYK2bux6WtSQ==
X-Received: by 10.237.54.196 with SMTP id f62mr6421435qtb.5.1465052516028;
        Sat, 04 Jun 2016 08:01:56 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.36.131.139 with SMTP id d133ls242315ite.38.gmail; Sat, 04 Jun
 2016 08:01:55 -0700 (PDT)
X-Received: by 10.36.53.137 with SMTP id k131mr129642ita.0.1465052515073;
        Sat, 04 Jun 2016 08:01:55 -0700 (PDT)
In-Reply-To: <3c0fde91-671d-4751-955d-7b04cfa120bc@isocpp.org>
X-Original-Sender: alexander.zywicki@gmail.com
Precedence: list
Mailing-list: list std-proposals@isocpp.org; contact std-proposals+owners@isocpp.org
List-ID: <std-proposals.isocpp.org>
X-Spam-Checked-In-Group: 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:26180
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/26180>

------=_Part_337_1705757657.1465052514079
Content-Type: multipart/alternative; 
	boundary="----=_Part_338_1396042668.1465052514079"

------=_Part_338_1396042668.1465052514079
Content-Type: text/plain; charset=UTF-8

 Here is a proposed implementation of the definition of a sample:

#include <type_traits>

//if sample must be signed when integer
template<typename T>
struct is_sample :public std::integral_constant<bool,std::is_floating_point<
T>::value || (std::is_integral<T>::value && std::is_signed<T>::value)>{};

//otherwise
template<typename T>
using is_sample = std::is_arithmetic<T>;

In order for some type T to be valid as a sample it must pass 
"is_sample<T>" 



-- 
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/aa7736b2-9a2a-4b52-84ee-790e8548572f%40isocpp.org.

------=_Part_338_1396042668.1465052514079
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><span class=3D"IVILX2C-tb-q"><span></span> </span>      <d=
iv class=3D"IVILX2C-tb-P" tabindex=3D"0"><input style=3D"opacity: 0; height=
: 1px; width: 1px; z-index: -1; overflow: hidden; position: absolute;" role=
=3D"presentation" tabindex=3D"-1" type=3D"text"><div><div style=3D"overflow=
: auto"><div style=3D"max-height: 10000px;"><div dir=3D"ltr">Here is a prop=
osed implementation of the definition of a sample:<br><br><div style=3D"bac=
kground-color:rgb(250,250,250);border-color:rgb(187,187,187);border-style:s=
olid;border-width:1px;word-wrap:break-word"><code><div><span style=3D"color=
:#800">#include</span><span style=3D"color:#000"> </span><span style=3D"col=
or:#080">&lt;type_traits&gt;</span><span style=3D"color:#000"><br><br></spa=
n><span style=3D"color:#800">//if sample must be signed when integer</span>=
<span style=3D"color:#000"><br></span><span style=3D"color:#008">template</=
span><span style=3D"color:#660">&lt;</span><span style=3D"color:#008">typen=
ame</span><span style=3D"color:#000"> T</span><span style=3D"color:#660">&g=
t;</span><span style=3D"color:#000"><br></span><span style=3D"color:#008">s=
truct</span><span style=3D"color:#000"> is_sample </span><span style=3D"col=
or:#660">:</span><span style=3D"color:#008">public</span><span style=3D"col=
or:#000"> std</span><span style=3D"color:#660">::</span><span style=3D"colo=
r:#000">integral_constant</span><span style=3D"color:#660">&lt;</span><span=
 style=3D"color:#008">bool</span><span style=3D"color:#660">,</span><span s=
tyle=3D"color:#000">st<wbr>d</span><span style=3D"color:#660">::</span><spa=
n style=3D"color:#000">is_floating_point</span><span style=3D"color:#660">&=
lt;</span><span style=3D"color:#000">T</span><span style=3D"color:#660">&gt=
;::</span><span style=3D"color:#000">value </span><span style=3D"color:#660=
">||</span><span style=3D"color:#000"> </span><span style=3D"color:#660">(<=
/span><span style=3D"color:#000">std</span><span style=3D"color:#660">::</s=
pan><span style=3D"color:#000">is_integral</span><span style=3D"color:#660"=
>&lt;</span><span style=3D"color:#000">T</span><span style=3D"color:#660">&=
gt;::</span><span style=3D"color:#000">value </span><span style=3D"color:#6=
60">&amp;&amp;</span><span style=3D"color:#000"> std</span><span style=3D"c=
olor:#660">::</span><span style=3D"color:#000">is_signed</span><span style=
=3D"color:#660">&lt;</span><span style=3D"color:#000">T</span><span style=
=3D"color:#660">&gt;::</span><span style=3D"color:#000">value</span><span s=
tyle=3D"color:#660">)&gt;{};</span><span style=3D"color:#000"><br><br></spa=
n><span style=3D"color:#800">//otherwise</span><span style=3D"color:#000"><=
br></span><span style=3D"color:#008">template</span><span style=3D"color:#6=
60">&lt;</span><span style=3D"color:#008">typename</span><span style=3D"col=
or:#000"> T</span><span style=3D"color:#660">&gt;</span><span style=3D"colo=
r:#000"><br></span><span style=3D"color:#008">using</span><span style=3D"co=
lor:#000"> is_sample </span><span style=3D"color:#660">=3D</span><span styl=
e=3D"color:#000"> std</span><span style=3D"color:#660">::</span><span style=
=3D"color:#000">is_arithmetic</span><span style=3D"color:#660">&lt;</span><=
span style=3D"color:#000">T</span><span style=3D"color:#660">&gt;;</span></=
div></code></div><br>In order for some type T to be valid as a sample it mu=
st pass &quot;is_sample&lt;T&gt;&quot; </div></div></div></div></div><br><b=
r><br></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/aa7736b2-9a2a-4b52-84ee-790e8548572f%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/aa7736b2-9a2a-4b52-84ee-790e8548572f=
%40isocpp.org</a>.<br />

------=_Part_338_1396042668.1465052514079--

------=_Part_337_1705757657.1465052514079--

.
