220 23245 <0c101390-8938-483d-91a8-e1f4a83bdefb@isocpp.org> article
Path: news.gmane.org!not-for-mail
From: Casey Carter <cartec69@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: n4428 and Tuple-like access interface reflection
Date: Mon, 28 Dec 2015 21:08:25 -0800 (PST)
Lines: 163
Approved: news@gmane.org
Message-ID: <0c101390-8938-483d-91a8-e1f4a83bdefb@isocpp.org>
References: <56770133.7070701@wanadoo.fr>
 <5681D877.3010101@wanadoo.fr>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_55_1173483533.1451365706073"
X-Trace: ger.gmane.org 1451365714 4117 80.91.229.3 (29 Dec 2015 05:08:34 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Tue, 29 Dec 2015 05:08:34 +0000 (UTC)
Cc: reflection@isocpp.org
To: ISO C++ Standard - Future Proposals <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBD2MLWWVRQMRBS5KRC2AKGQEEKXGXSQ@isocpp.org Tue Dec 29 06:08:31 2015
Return-path: <std-proposals+bncBD2MLWWVRQMRBS5KRC2AKGQEEKXGXSQ@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-io0-f199.google.com ([209.85.223.199])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBD2MLWWVRQMRBS5KRC2AKGQEEKXGXSQ@isocpp.org>)
	id 1aDmWM-0001On-2K
	for gclcip-std-proposals@m.gmane.org; Tue, 29 Dec 2015 06:08:30 +0100
Original-Received: by mail-io0-f199.google.com with SMTP id 77sf95717533ioc.2
        for <gclcip-std-proposals@m.gmane.org>; Mon, 28 Dec 2015 21:08:29 -0800 (PST)
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:content-type: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=ttcNgMuTCAiPYjPqx0gXetzIcneNUbJvKBZHiKGIpYA=;
        b=Mz6m68UD384R94VSOrfmc0zJz7J1iLtIz4+KZifFkmci5BdG++ofZSExUmHy0V9vM4
         ceynHnVG69GuBQ9d1RWMNOvJmxvEvnbGM/I+AF9VLimH/hmZ39IPPXwtVjurJsdIfLN/
         oo/p8aj9yuEM/KZW2Qbol9zPykjeUMngwgLp03amaYNB+XlUPoFMFfpMxHJ2lckCDhAa
         U805slwGFjRsChWqGBWGKuUoOshNe3Vd96w/CxFwg16P0xAfTv8AMcz2seNgSBzgKhTd
         Hwzfa+Nn8dRw3SUAmddIZBoXEPXRt+DyS6YXl3FkjAPxeQPq5nVNZ+GVy+pUcTGDRH5X
         sf1Q==
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:content-type: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=ttcNgMuTCAiPYjPqx0gXetzIcneNUbJvKBZHiKGIpYA=;
        b=f4C9wsniJG6WO/EbIgLNEKq/t4IanIH5qzGW0JhlezTCkQEiYee1pMbUr0sEjK91kr
         bbMGYb54To7wL/kVvrsP6wKFcjej0rKckHnbAfSX6om1h5dfG5yTKiazNhOgclwFkPJj
         jLDI9eZMth0qZRXIebt4F6S0l2yoRSqLlicOoOCKIV2tpRgbIN0Svklj+sbpdgvOfh1j
         +JWKpXZO41FS87e4H52MCnKhD28TTvib74ygtPnox7LblwpQXizAEejO+lW6ug/X2eEn
         QMeFsTcYisWy5p2rm5ZhZ2eG/03Qzg6I6RuaJIotOzDtLJ/usmotpe5cyJzOfEWDFsFr
         9wvw==
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:content-type: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=ttcNgMuTCAiPYjPqx0gXetzIcneNUbJvKBZHiKGIpYA=;
        b=Ebyq62wNiQizAUukKV9Jr3lGjfNAYAQun/9liWxRwOdkdwzwRPZme8VMkxGfP95yZs
         YfIuONi8r51AulIixgTXQh807fDtGCvhcHiFscQhlJf/XVwUphhJUmo+tYM6VreYQqyc
         1zSvVC8ddXAtNXgWF3+udRajibz9leHuvLXgfoNGGpHQmkbZ/OdEr5bMUGJrZpLewww4
         2GVP3q4giPMCkRSvVEjN4IfZ9wq+cQSnl0UXdOMiExPFdViovo02XzaN+tUpkFB58RBT
         fr+lFY/MbwGMUPR+jz7eOLMUG4Qb2oGDResWyrhdQGrqQOQz7oeEx0UYbUuQC4Zu58IS
         3dQA==
X-Gm-Message-State: ALoCoQkavt3bHtXFvSsfcXeprXruCkT5B/1+viiZwE8a56VMeLJES/YEylabHFQxbdqqz5EP/hhHp/CT12a3Hgsr+DvhxA7Lhw==
X-Received: by 10.50.3.98 with SMTP id b2mr49556650igb.8.1451365708564;
        Mon, 28 Dec 2015 21:08:28 -0800 (PST)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.50.122.9 with SMTP id lo9ls3064596igb.16.gmail; Mon, 28 Dec
 2015 21:08:27 -0800 (PST)
X-Received: by 10.50.25.196 with SMTP id e4mr223077igg.8.1451365707634;
        Mon, 28 Dec 2015 21:08:27 -0800 (PST)
In-Reply-To: <5681D877.3010101@wanadoo.fr>
X-Original-Sender: cartec69@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:23245
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/23245>

------=_Part_55_1173483533.1451365706073
Content-Type: multipart/alternative; 
	boundary="----=_Part_56_1528315012.1451365706074"

------=_Part_56_1528315012.1451365706074
Content-Type: text/plain; charset=UTF-8


On Monday, December 28, 2015 at 6:48:58 PM UTC-6, Vicente J. Botet Escriba 
wrote:
>
> I have added a trait tuple_like that states if I want the generation 
>
> template <class T>
> struct tuple_like: false_type {};
>
> but I don't see how to make the specialization conditional to this traits 
> without adding an Enabler parameter
>
>     template <class T, class Enabler=void>
>     struct tuple_size;
>     template <size_t N, class T, class Enabler=void>
>     struct tuple_element;
>
> Is there a way without changing the std::tuple_size and std::tuple_element 
> template parameters?
> What would be the the correct way to do that?
>
>
template <class T>
requires tuple_like<T>::value
struct tuple_size<T> : /* ... */;


template <size_t N, class T>
requires tuple_like<T>::value
struct tuple_element<N, 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.
Visit this group at https://groups.google.com/a/isocpp.org/group/std-proposals/.

------=_Part_56_1528315012.1451365706074
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<br>On Monday, December 28, 2015 at 6:48:58 PM UTC-6, Vicente J. Botet Escr=
iba wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-left:=
 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;">
 =20
   =20
 =20
  <div bgcolor=3D"#FFFFFF" text=3D"#000000">
    <blockquote type=3D"cite"><font size=3D"+1">I have added a trait </font=
><font size=3D"+1"><font size=3D"+1"><font size=3D"+1">tuple_like </font></=
font>that
          states if I want the generation <br>
        </font><br>
      <font size=3D"+1"><font size=3D"+1">template &lt;class T&gt;<br>
          struct tuple_like: false_type {};<br>
        </font></font><br>
      <font size=3D"+1">but I don&#39;t see how to make the specialization
        conditional to this traits without adding an Enabler parameter<br>
        <br>
      </font><font size=3D"+1"><font size=3D"+1">=C2=A0=C2=A0=C2=A0 templat=
e &lt;class
            T, class Enabler=3Dvoid&gt;<br>
          </font></font><font size=3D"+1"><font size=3D"+1">=C2=A0=C2=A0=C2=
=A0
            struct tuple_size;<br>
          </font></font><font size=3D"+1"><font size=3D"+1"><font size=3D"+=
1"><font size=3D"+1">=C2=A0=C2=A0=C2=A0 template &lt;size_t N, </font></fon=
t></font></font><font size=3D"+1"><font size=3D"+1"><font size=3D"+1"><font=
 size=3D"+1"><font size=3D"+1"><font size=3D"+1">class T, class Enabler=3Dv=
oid</font></font>&gt;<br>
                =C2=A0=C2=A0=C2=A0 struct tuple_element;<br>
                <br>
              </font></font></font></font><font size=3D"+1"><font size=3D"+=
1">Is there a way without changing the
            std::tuple_size and </font></font><font size=3D"+1"><font size=
=3D"+1"><font size=3D"+1"><font size=3D"+1">std::</font></font>tuple_elemen=
t

            template parameters?<br>
          </font></font><font size=3D"+1"><font size=3D"+1"><font size=3D"+=
1">What would be the the correct way to do that?</font></font></font></bloc=
kquote></div></blockquote><div><br></div><div class=3D"prettyprint" style=
=3D"border: 1px solid rgb(187, 187, 187); word-wrap: break-word; background=
-color: rgb(250, 250, 250);"><code class=3D"prettyprint"><div class=3D"subp=
rettyprint"><span style=3D"color: #008;" class=3D"styled-by-prettify">templ=
ate</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> </span=
><span style=3D"color: #660;" class=3D"styled-by-prettify">&lt;</span><span=
 style=3D"color: #008;" class=3D"styled-by-prettify">class</span><span styl=
e=3D"color: #000;" class=3D"styled-by-prettify"> T</span><span style=3D"col=
or: #660;" class=3D"styled-by-prettify">&gt;</span><span style=3D"color: #0=
00;" class=3D"styled-by-prettify"><br>requires tuple_like</span><span style=
=3D"color: #660;" class=3D"styled-by-prettify">&lt;</span><span style=3D"co=
lor: #000;" class=3D"styled-by-prettify">T</span><span style=3D"color: #660=
;" class=3D"styled-by-prettify">&gt;::</span><span style=3D"color: #000;" c=
lass=3D"styled-by-prettify">value<br></span><span style=3D"color: #008;" cl=
ass=3D"styled-by-prettify">struct</span><span style=3D"color: #000;" class=
=3D"styled-by-prettify"> tuple_size</span><span style=3D"color: #660;" clas=
s=3D"styled-by-prettify">&lt;</span><span style=3D"color: #000;" class=3D"s=
tyled-by-prettify">T</span><span style=3D"color: #660;" class=3D"styled-by-=
prettify">&gt;</span><span style=3D"color: #000;" class=3D"styled-by-pretti=
fy"> </span><span style=3D"color: #660;" class=3D"styled-by-prettify">:</sp=
an><span style=3D"color: #000;" class=3D"styled-by-prettify"> </span><span =
style=3D"color: #800;" class=3D"styled-by-prettify">/* ... */</span><span s=
tyle=3D"color: #660;" class=3D"styled-by-prettify">;</span><span style=3D"c=
olor: #000;" class=3D"styled-by-prettify"><br><br><br></span><span style=3D=
"color: #008;" class=3D"styled-by-prettify">template</span><span style=3D"c=
olor: #000;" class=3D"styled-by-prettify"> </span><span style=3D"color: #66=
0;" class=3D"styled-by-prettify">&lt;</span><span style=3D"color: #000;" cl=
ass=3D"styled-by-prettify">size_t N</span><span style=3D"color: #660;" clas=
s=3D"styled-by-prettify">,</span><span style=3D"color: #000;" class=3D"styl=
ed-by-prettify"> </span><span style=3D"color: #008;" class=3D"styled-by-pre=
ttify">class</span><span style=3D"color: #000;" class=3D"styled-by-prettify=
"> T</span><span style=3D"color: #660;" class=3D"styled-by-prettify">&gt;</=
span><span style=3D"color: #000;" class=3D"styled-by-prettify"><br>requires=
 tuple_like</span><span style=3D"color: #660;" class=3D"styled-by-prettify"=
>&lt;</span><span style=3D"color: #000;" class=3D"styled-by-prettify">T</sp=
an><span style=3D"color: #660;" class=3D"styled-by-prettify">&gt;::</span><=
span style=3D"color: #000;" class=3D"styled-by-prettify">value<br></span><s=
pan style=3D"color: #008;" class=3D"styled-by-prettify">struct</span><span =
style=3D"color: #000;" class=3D"styled-by-prettify"> tuple_element</span><s=
pan style=3D"color: #660;" class=3D"styled-by-prettify">&lt;</span><span st=
yle=3D"color: #000;" class=3D"styled-by-prettify">N</span><span style=3D"co=
lor: #660;" class=3D"styled-by-prettify">,</span><span style=3D"color: #000=
;" class=3D"styled-by-prettify"> T</span><span style=3D"color: #660;" class=
=3D"styled-by-prettify">&gt;</span><span style=3D"color: #000;" class=3D"st=
yled-by-prettify"> </span><span style=3D"color: #660;" class=3D"styled-by-p=
rettify">:</span><span style=3D"color: #000;" class=3D"styled-by-prettify">=
 </span><span style=3D"color: #800;" class=3D"styled-by-prettify">/* ... */=
</span><span style=3D"color: #660;" class=3D"styled-by-prettify">;</span><s=
pan style=3D"color: #000;" class=3D"styled-by-prettify"><br></span><span st=
yle=3D"color: #000;" class=3D"styled-by-prettify"><br></span></div></code><=
/div><div><div><br><br></div></div>

<p></p>

-- <br />
<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 <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 />
Visit this group at <a href=3D"https://groups.google.com/a/isocpp.org/group=
/std-proposals/">https://groups.google.com/a/isocpp.org/group/std-proposals=
/</a>.<br />

------=_Part_56_1528315012.1451365706074--
------=_Part_55_1173483533.1451365706073--

.
