220 22230 <0fcfc169-4076-4569-9089-4bc80e65d469@isocpp.org> article
Path: news.gmane.org!not-for-mail
From: yannick.daveluy@gmail.com
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Adding virtual/private/protected/public keywords
 in template parameter
Date: Wed, 4 Nov 2015 00:08:38 -0800 (PST)
Lines: 168
Approved: news@gmane.org
Message-ID: <0fcfc169-4076-4569-9089-4bc80e65d469@isocpp.org>
References: <c64002b9-5ae4-4b0e-9cfa-f004ca185f24@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_6106_1051089625.1446624518488"
X-Trace: ger.gmane.org 1446624522 5589 80.91.229.3 (4 Nov 2015 08:08:42 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Wed, 4 Nov 2015 08:08:42 +0000 (UTC)
Cc: yannick.daveluy@gmail.com
To: ISO C++ Standard - Future Proposals <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBDTMBZFA54HBBB7242YQKGQEUTDFNLA@isocpp.org Wed Nov 04 09:08:42 2015
Return-path: <std-proposals+bncBDTMBZFA54HBBB7242YQKGQEUTDFNLA@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-ob0-f200.google.com ([209.85.214.200])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBDTMBZFA54HBBB7242YQKGQEUTDFNLA@isocpp.org>)
	id 1Ztt7Z-0007sm-K8
	for gclcip-std-proposals@m.gmane.org; Wed, 04 Nov 2015 09:08:41 +0100
Original-Received: by obbxp9 with SMTP id xp9sf1143840obb.2
        for <gclcip-std-proposals@m.gmane.org>; Wed, 04 Nov 2015 00:08:40 -0800 (PST)
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=3Be6U2q61MfVEI5XjsXNO9Cmk/JNUEcanYQ6K2MH2ak=;
        b=iF/Wv5cBX9W2s0NCZur7NSGJgtjzAJdXLx6Spr6eNCAassLegqUMAJg7ZRm0f1IjVu
         50sb7lKTtI5wLNRzlhjg1WsmZKB9qPh9XfXmQMrQkyYtdursbBtmb2KIQllTm/1U+mj5
         m2ypB3NJOAjg0ZuvBj8ch6YodlsCJbBsPhM5kHcN4thECE6I9jGVLeRyrU9B33DJYEdj
         9ox/I4/FZEfZF4ExGubeD8LSuB1fRoJqcPMEZA7JK8hKKX3UYsK5stoRBklD2MF2XuJq
         RbmdRhWFG59EtICeUkHWiQU8B23W+KU7A49XSQ30CBx6bqXfL4KYQzDG+LF9fiSSFXwd
         W+ow==
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=3Be6U2q61MfVEI5XjsXNO9Cmk/JNUEcanYQ6K2MH2ak=;
        b=eq7di5h4ILVYrSKQZGZ7UbY2gJefc6PgaivskVhSy1aPVoVzFU7fxh1jGaQlPGwc+F
         2Aa6Wv3yKpYyAbrAmuhyVl5h4xHpaj0eeCnORLEBQOVfkLo3hn6zN2QAboTcw2OQvSha
         LpEWIwStTQFQWXRv+5AQXwLpyUkJCJy2qCMTED6ntJZbDz46KgWC5/KXPbiL38kR8YuM
         K0rakEJfZGuRK0VCgQl0H5VFWn7A6BxvJ7PRJd7c6p+1qcJvh0108IMk97F3VLZIuz5o
         KprX+sOcud4+AWzcmA154lBaJzQqdhIpWkjUuYjjAxX9c14CQ+8nbd7+ZdEmifLbb07z
         o0zg==
X-Gm-Message-State: ALoCoQlh6Nwuog7l1Rq2xvf+GRJ8srJFh/vDAmHV+IV4A52IPfBhCev85wdFY+Xp3Am8cl6G9Bg2
X-Received: by 10.182.225.230 with SMTP id rn6mr161786obc.20.1446624520627;
        Wed, 04 Nov 2015 00:08:40 -0800 (PST)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.50.152.98 with SMTP id ux2ls312784igb.39.gmail; Wed, 04 Nov
 2015 00:08:39 -0800 (PST)
X-Received: by 10.50.83.40 with SMTP id n8mr27727igy.1.1446624519675;
        Wed, 04 Nov 2015 00:08:39 -0800 (PST)
In-Reply-To: <c64002b9-5ae4-4b0e-9cfa-f004ca185f24@isocpp.org>
X-Original-Sender: yannick.daveluy@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: <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: <mailto:googlegroups-manage+399137483710+unsubscribe@googlegroups.com>,
 <http://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>
Xref: news.gmane.org gmane.comp.lang.c++.isocpp.proposals:22230
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/22230>

------=_Part_6106_1051089625.1446624518488
Content-Type: multipart/alternative; 
	boundary="----=_Part_6107_1195752805.1446624518489"

------=_Part_6107_1195752805.1446624518489
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

The direct application is nested inheritance.

It's easier to illustrate it with an example:

/* A generic interface File */
class IF
{
/* stubs interfaces */
struct a{};
struct b{};
....
struct z{};
};

/* a generic model built from interfaces */

*template <class ... BaseClasses>class Model: *

*BaseClasses...{*
*struct a: *
*BaseClasses::a...{};struct b*

*: BaseClasses::b...{};...struct z*
*: BaseClasses::z...{};};*};

/* Some user sp=C3=A9cific models */
class UserModelIF1
{
/* only implement needed interfaces */
struct g { int i; float f;};
};
class UserModelIF2
{
/* only implement needed interfaces */
struct t { int i; float f;};
};

class UserModel: public *Model<public virtual *UserModelIF1, protected=20
UserModelIF2>
{
UserModel()
{
/* struct X would be a composition of all inherited interfaces */
};
};


Yannick=20
Le mardi 3 novembre 2015 10:45:42 UTC+1, yannick...@gmail.com a =C3=A9crit =
:
>
>
> When using variadic templates,  the syntax does not allow to use virtual,=
=20
> private, protected and public keywords prefixs for parameters.
>
>
> e.g:
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> *template <class ... BaseClasses>class A: BaseClasses...{    struct S:=20
> BaseClasses::S... {};};class B{    struct S{};};class C{    struct=20
> S{};};class D: public A< public virtual B, protected C > // =3D>do not=20
> compile{};=3D=3D> D should inherit from the following class A':class A': =
public=20
> virtual B, protected C{    struct S: public virtual B::S, protected=20
> C::S{};};*
>
> Yannick
>
>

--=20

---=20
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 e=
mail 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-proposa=
ls/.

------=_Part_6107_1195752805.1446624518489
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">The direct application is nested inheritance.<br><br>It&#3=
9;s easier to illustrate it with an example:<br><br>/* A generic interface =
File */<br>class IF<br>{<br>/* stubs interfaces */<br>struct a{};<br>struct=
 b{};<br>...<br>struct z{};<br>};<br><br>/* a generic model built from inte=
rfaces */<br><i>template &lt;class ... BaseClasses&gt;<br>class Model: </i>=
<i><i>BaseClasses</i>...<br>{<br></i><br><i>struct a: </i><i><i>BaseClasses=
::a...</i>{};<br>struct b</i><i><i>: </i><i><i>BaseClasses::b...</i></i>{};=
<br>...<br>struct z</i><i><i>: </i><i><i>BaseClasses::z...</i></i>{};};<br>=
</i>};<br><br>/* Some user sp=C3=A9cific models */<br>class UserModelIF1<br=
>{<br>/* only implement needed interfaces */<br>struct g { int i; float f;}=
;<br>};<br>class UserModelIF2<br>{<br>/* only implement needed interfaces *=
/<br>struct t { int i; float f;};<br>};<br><br>class UserModel: public <i>M=
odel&lt;public virtual </i>UserModelIF1, protected UserModelIF2&gt;<br>{<br=
>UserModel()<br>{<br>/* struct X would be a composition of all inherited in=
terfaces */<br>};<br>};<br><br><br>Yannick <br>Le mardi 3 novembre 2015 10:=
45:42 UTC+1, yannick...@gmail.com a =C3=A9crit=C2=A0:<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"><br>When using variadic templates,=
=C2=A0 the syntax does not allow to use virtual, private, protected and pub=
lic keywords prefixs for parameters.<br><br><br>e.g:<br><div style=3D"margi=
n-left:40px"><br></div><div style=3D"margin-left:40px"><i>template &lt;clas=
s ... BaseClasses&gt;<br>class A: BaseClasses...<br>{<br>=C2=A0=C2=A0=C2=A0=
 struct S: BaseClasses::S... {};<br>};<br><br>class B<br>{<br>=C2=A0=C2=A0=
=C2=A0 struct S{};<br>};<br>class C<br>{<br>=C2=A0=C2=A0=C2=A0 struct S{};<=
br>};<br><br><br>class D: public A&lt; public virtual B, protected C &gt; /=
/ =3D&gt;do not compile<br>{<br>};<br><br>=3D=3D&gt; D should inherit from =
the following class A&#39;:<br>class A&#39;: public virtual B, protected C<=
br>{<br>=C2=A0=C2=A0=C2=A0 struct S: public virtual B::S, protected C::S{};=
<br>};<br></i></div><br>Yannick<br><br></div></blockquote></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"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

------=_Part_6107_1195752805.1446624518489--
------=_Part_6106_1051089625.1446624518488--

.
