220 14200 <14ff5bcb-5efb-46da-9b86-54382363c3b0@isocpp.org> article
Path: news.gmane.org!not-for-mail
From: contact@ncomputers.org
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Re: Templetized namespaces
Date: Fri, 24 Oct 2014 08:59:20 -0700 (PDT)
Lines: 369
Approved: news@gmane.org
Message-ID: <14ff5bcb-5efb-46da-9b86-54382363c3b0@isocpp.org>
References: <CAFdMc-214LLZ3GtZyd3rZ1MwM4Q0qaTZFZmkXuyDPVZDU6aJ=w@mail.gmail.com>
 <4cfc2db6-97da-4750-9296-5aaaa3475014@isocpp.org>
 <CAOfiQqk_g0nwNP1TZndqrvmBAtqjhXsC0bAFax0nXwCPvwDw6g@mail.gmail.com>
 <CAOU91OPot_7v7vUAZijdU-iqYu=iGsaj4jShf9endWmG-DUrdw@mail.gmail.com>
 <CAFdMc-1AbUTsE-mkvs0Sbcp7J4-_eb6epevLkXUBuGoNYUVgrg@mail.gmail.com>
 <CAOU91OMHqxODvnzpHHSk_bgNUnAoFFqTUc5xTAB3xzUMMk5gkQ@mail.gmail.com>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: multipart/alternative; 
	boundary="----=_Part_217_1200739447.1414166360021"
X-Trace: ger.gmane.org 1414166369 20864 80.91.229.3 (24 Oct 2014 15:59:29 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Fri, 24 Oct 2014 15:59:29 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBC4MBZFHTYJRBWHOVGRAKGQEZPFGNMQ@isocpp.org Fri Oct 24 17:59:24 2014
Return-path: <std-proposals+bncBC4MBZFHTYJRBWHOVGRAKGQEZPFGNMQ@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-oi0-f71.google.com ([209.85.218.71])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBC4MBZFHTYJRBWHOVGRAKGQEZPFGNMQ@isocpp.org>)
	id 1XhhGs-0005fb-DK
	for gclcip-std-proposals@m.gmane.org; Fri, 24 Oct 2014 17:59:22 +0200
Original-Received: by mail-oi0-f71.google.com with SMTP id v63sf5101248oia.6
        for <gclcip-std-proposals@m.gmane.org>; Fri, 24 Oct 2014 08:59:21 -0700 (PDT)
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: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=hM+IXAwFPc5wqyQSuClFsn9fuN6BdinBVUVjjVq/Ph4=;
        b=efAL2mA3ockS2ASX2OTdytg2maEyBPPoxnmW3pseMTrHO3VmRGN+X5wGPPNz5etMh7
         tIKH9ohLU8GxLGH/gczXWQDaEYS0m+MEjX26Q/ryas1RGZK6P1sQWlDvREzPkK/xIlxd
         i7IOVmcT0QerE658x5lTFkvSmZjgFtKG/5BqZlGlVyCzg+04t/K8mV+G8kPiDEYABNUn
         LwZ6Hv+jInxGgs5pZuCeIazkDmVGN5c6/laEyala4dIs7IqE7CpjN22FkE2OjA+1YN92
         +NstYdEdmNbdWSRve5Z7cOrYSBXyaOXDchrqlwfXdmepI5AtXbOpoZCX0AppN0eURaxs
         uoKg==
X-Gm-Message-State: ALoCoQkD3ulrz6rxOCwG1QbWyGSDm/n4ThhLwv/nHuuWhB5LETPy0FVVnYnISz8cyGJKbk6JI3Ab
X-Received: by 10.182.247.101 with SMTP id yd5mr7850075obc.41.1414166361501;
        Fri, 24 Oct 2014 08:59:21 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.182.40.136 with SMTP id x8ls613097obk.54.gmail; Fri, 24 Oct
 2014 08:59:20 -0700 (PDT)
X-Received: by 10.182.138.101 with SMTP id qp5mr648obb.42.1414166360558;
        Fri, 24 Oct 2014 08:59:20 -0700 (PDT)
In-Reply-To: <CAOU91OMHqxODvnzpHHSk_bgNUnAoFFqTUc5xTAB3xzUMMk5gkQ@mail.gmail.com>
X-Original-Sender: contact@ncomputers.org
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: <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:14200
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/14200>

------=_Part_217_1200739447.1414166360021
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

I think that templetized templates should be allowed using nested=20
namespaces by classes, for example:

template<typename Typename>
class A{
    namespace B{
        Typename Variable;
    }
};

PF, ncomputers

Am Freitag, 24. Oktober 2014 06:48:09 UTC-5 schrieb Klaim - Jo=C3=ABl Lamot=
te:
>
> Sorry I didn't see your reply before.
>
> On Sun, Jan 26, 2014 at 1:52 AM, dgutson . <daniel...@gmail.com=20
> <javascript:>> wrote:
>
>> On Wed, Jan 22, 2014 at 9:47 AM, Klaim - Jo=C3=ABl Lamotte <mjk...@gmail=
..com=20
>> <javascript:>> wrote:
>>
>>> I had the exact same ideas few months ago after finding myself doing=20
>>> generic library which all types would depend on the same type,
>>> and remarking how much duplication could be avoided if I was allowed to=
=20
>>> specify that a whole bunch of types would automatically have an additio=
nal=20
>>> template parameter implicitly.
>>>
>>> namespace blah< typename X >
>>> {
>>>      class K {};
>>>      template < class T > class U {};
>>> }
>>>
>>> would be translated to=20
>>>
>>> namespace blah
>>> {
>>>     template< typename X >
>>>     class K {};
>>>     template< typename X, class T > class U {};
>>> }
>>>
>>>
>>> However, after weeks of thinking about this I concluded that:
>>>
>>>  1. namespace are not the appropriate construct for this, they really=
=20
>>> are too different and not really encapsulating anything than names;
>>>  2. there are a lot of potential issues related to the order of templat=
e=20
>>> arguments;
>>>
>>
>> Please elaborate about the last two points.
>> =20
>>
>
> Basically, namespaces don't have a unique definition and are only=20
> affecting naming.
> Therefore, what would be better to template would be something like a=20
> module or a class or a mixin (a class component).
>
> =20
>
>>   3. there is a potential issue for reading the code as you need to see=
=20
>>> the namespace declaration before being able to follow the rest of the c=
ode.
>>>
>>
>> I don't find this issue different than any other template declaration,=
=20
>> for example a nested class of a template class.
>> =20
>>
>
> Yes, it's a weak point but apparently some people have trouble with this.
> Not sure if it should be taken into account.
> =20
>
>>      What I mean here is basically the same argument that makes Clang=20
>>> developers avoid anonymous namespaces.
>>>
>>> Also, I believe that the real thing I do want when I'm writing these=20
>>> generic libraries is actually to generate a whole bunch of types, using=
=20
>>> another type as argument of the process to generate the wanted types.
>>>
>>
>> We agree on that.
>> =20
>>
>>>  Basically, I want one of the features that the Reflection group is=20
>>> supposed to look for.
>>>
>>
>> I'm working on statement-templates.googlecode.com but that's something I=
=20
>> will post in this list later.
>> =20
>>
>>>
>>> Since that realization, I think that efforts should be put to have a ne=
w=20
>>> reflection construct instead of making namespace do something too diffe=
rent=20
>>> from it's initial use.
>>>
>>>
>>>
>>>  --=20
>>> =20
>>> ---=20
>>> You received this message because you are subscribed to the Google=20
>>> Groups "ISO C++ Standard - Future Proposals" group.
>>> To unsubscribe from this group and stop receiving emails from it, send=
=20
>>> an email to std-proposal...@isocpp.org <javascript:>.
>>> To post to this group, send email to std-pr...@isocpp.org <javascript:>=
..
>>> Visit this group at=20
>>> http://groups.google.com/a/isocpp.org/group/std-proposals/.
>>>
>>
>>
>>
>> --=20
>> Who=E2=80=99s got the sweetest disposition?
>> One guess, that=E2=80=99s who?
>> Who=E2=80=99d never, ever start an argument?
>> Who never shows a bit of temperament?
>> Who's never wrong but always right?
>> Who'd never dream of starting a fight?
>> Who get stuck with all the bad luck?=20
>>
>> --=20
>> =20
>> ---=20
>> You received this message because you are subscribed to the Google Group=
s=20
>> "ISO C++ Standard - Future Proposals" group.
>> To unsubscribe from this group and stop receiving emails from it, send a=
n=20
>> email to std-proposal...@isocpp.org <javascript:>.
>> To post to this group, send email to std-pr...@isocpp.org <javascript:>.
>> Visit this group at=20
>> http://groups.google.com/a/isocpp.org/group/std-proposals/.
>>
>
>

--=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_217_1200739447.1414166360021
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">I think that templetized templates should be allowed using=
 nested namespaces by classes, for example:<br><br><div class=3D"prettyprin=
t" style=3D"background-color: rgb(250, 250, 250); border-color: rgb(187, 18=
7, 187); border-style: solid; border-width: 1px; word-wrap: break-word;"><c=
ode class=3D"prettyprint"><div class=3D"subprettyprint"><span style=3D"colo=
r: #008;" class=3D"styled-by-prettify">template</span><span style=3D"color:=
 #660;" class=3D"styled-by-prettify">&lt;</span><span style=3D"color: #008;=
" class=3D"styled-by-prettify">typename</span><span style=3D"color: #000;" =
class=3D"styled-by-prettify"> </span><span style=3D"color: #606;" class=3D"=
styled-by-prettify">Typename</span><span style=3D"color: #660;" class=3D"st=
yled-by-prettify">&gt;</span><span style=3D"color: #000;" class=3D"styled-b=
y-prettify"><br></span><span style=3D"color: #008;" class=3D"styled-by-pret=
tify">class</span><span style=3D"color: #000;" class=3D"styled-by-prettify"=
> A</span><span style=3D"color: #660;" class=3D"styled-by-prettify">{</span=
><span style=3D"color: #000;" class=3D"styled-by-prettify"><br>&nbsp; &nbsp=
; </span><span style=3D"color: #008;" class=3D"styled-by-prettify">namespac=
e</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> B</span>=
<span style=3D"color: #660;" class=3D"styled-by-prettify">{</span><span sty=
le=3D"color: #000;" class=3D"styled-by-prettify"><br>&nbsp; &nbsp; &nbsp; &=
nbsp; </span><span style=3D"color: #606;" class=3D"styled-by-prettify">Type=
name</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> </spa=
n><span style=3D"color: #606;" class=3D"styled-by-prettify">Variable</span>=
<span style=3D"color: #660;" class=3D"styled-by-prettify">;</span><span sty=
le=3D"color: #000;" class=3D"styled-by-prettify"><br>&nbsp; &nbsp; </span><=
span style=3D"color: #660;" class=3D"styled-by-prettify">}</span><span styl=
e=3D"color: #000;" class=3D"styled-by-prettify"><br></span><span style=3D"c=
olor: #660;" class=3D"styled-by-prettify">};</span><span style=3D"color: #0=
00;" class=3D"styled-by-prettify"><br></span></div></code></div><br>PF, nco=
mputers<br><br>Am Freitag, 24. Oktober 2014 06:48:09 UTC-5 schrieb Klaim - =
Jo=C3=ABl Lamotte:<blockquote class=3D"gmail_quote" style=3D"margin: 0;marg=
in-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir=3D"=
ltr">Sorry I didn't see your reply before.<br><div><br><div class=3D"gmail_=
quote">On Sun, Jan 26, 2014 at 1:52 AM, dgutson . <span dir=3D"ltr">&lt;<a =
href=3D"javascript:" target=3D"_blank" gdf-obfuscated-mailto=3D"yMFBNKkM8DM=
J" onmousedown=3D"this.href=3D'javascript:';return true;" onclick=3D"this.h=
ref=3D'javascript:';return true;">daniel...@gmail.com</a>&gt;</span> wrote:=
<br><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-lef=
t:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr"><div><div class=3D"gmai=
l_quote"><span>On Wed, Jan 22, 2014 at 9:47 AM, Klaim - Jo=C3=ABl Lamotte <=
span dir=3D"ltr">&lt;<a href=3D"javascript:" target=3D"_blank" gdf-obfuscat=
ed-mailto=3D"yMFBNKkM8DMJ" onmousedown=3D"this.href=3D'javascript:';return =
true;" onclick=3D"this.href=3D'javascript:';return true;">mjk...@gmail.com<=
/a>&gt;</span> wrote:<br>
<blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-=
left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;p=
adding-left:1ex"><div dir=3D"ltr"><div>I had the exact same ideas few month=
s ago after finding myself doing generic library which all types would depe=
nd on the same type,</div>
<div>and remarking how much duplication could be avoided if I was allowed t=
o specify that a whole bunch of types would automatically have an additiona=
l template parameter implicitly.</div>
<div><br></div><div>namespace blah&lt; typename X &gt;</div><div>{</div><di=
v>&nbsp; &nbsp; &nbsp;class K {};</div><div>&nbsp; &nbsp; &nbsp;template &l=
t; class T &gt; class U {};</div>

<div>}</div><div><br></div><div>would be translated to&nbsp;</div><div><br>=
</div><div>namespace blah</div><div>

{</div><div>&nbsp; &nbsp; template&lt; typename X &gt;</div><div>&nbsp; &nb=
sp; class K {};</div><div>&nbsp; &nbsp; template&lt; typename X, class T &g=
t; class U {};</div><div>

}</div><div><br></div><div><br></div><div>However, after weeks of thinking =
about this I concluded that:</div><div><br></div><div>

&nbsp;1. namespace are not the appropriate construct for this, they really =
are too different and not really encapsulating anything than names;</div><d=
iv>&nbsp;2. there are a lot of potential issues related to the order of tem=
plate arguments;</div>
</div></blockquote><div><br></div></span><div>Please elaborate about the la=
st two points.</div><span><div>&nbsp;</div></span></div></div></div></block=
quote><div><br></div><div>Basically, namespaces don't have a unique definit=
ion and are only affecting naming.</div><div>Therefore, what would be bette=
r to template would be something like a module or a class or a mixin (a cla=
ss component).</div><div><br></div><div>&nbsp;</div><blockquote class=3D"gm=
ail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-le=
ft:1ex"><div dir=3D"ltr"><div><div class=3D"gmail_quote"><span><blockquote =
class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left-width:1=
px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:=
1ex">
<div dir=3D"ltr">
<div>&nbsp;3. there is a potential issue for reading the code as you need t=
o see the namespace declaration before being able to follow the rest of the=
 code.</div></div></blockquote><div><br></div></span><div>I don't find this=
 issue different than any other template declaration, for example a nested =
class of a template class.</div><span>
<div>&nbsp;</div></span></div></div></div></blockquote><div><br></div><div>=
Yes, it's a weak point but apparently some people have trouble with this.</=
div><div>Not sure if it should be taken into account.</div><div>&nbsp;</div=
><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1=
px #ccc solid;padding-left:1ex"><div dir=3D"ltr"><div><div class=3D"gmail_q=
uote"><span><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0=
..8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-s=
tyle:solid;padding-left:1ex"><div dir=3D"ltr"><div>&nbsp; &nbsp; &nbsp;What=
 I mean here is basically the same argument that makes Clang developers avo=
id anonymous namespaces.</div>

<div><br></div><div>Also, I believe that the real thing I do want when I'm =
writing these generic libraries is actually to generate a whole bunch of ty=
pes, using another type as argument of the process to generate the wanted t=
ypes.</div>
</div></blockquote><div><br></div></span><div>We agree on that.</div><span>=
<div>&nbsp;</div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px =
0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-l=
eft-style:solid;padding-left:1ex">
<div dir=3D"ltr">
<div>Basically, I want one of the features that the Reflection group is sup=
posed to look for.</div></div></blockquote><div><br></div></span><div>I'm w=
orking on&nbsp;<a href=3D"http://statement-templates.googlecode.com" target=
=3D"_blank" onmousedown=3D"this.href=3D'http://statement-templates.googleco=
de.com';return true;" onclick=3D"this.href=3D'http://statement-templates.go=
oglecode.com';return true;">statement-templates.<wbr>googlecode.com</a> but=
 that's something I will post in this list later.</div>
<div>&nbsp;</div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px =
0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-l=
eft-style:solid;padding-left:1ex"><span><div dir=3D"ltr"><div><br></div>
<div>Since that realization, I think that efforts should be put to have a n=
ew reflection construct instead of making namespace do something too differ=
ent from it's initial use.</div>
<div><br></div><div><br></div><div><br></div></div></span><span><div><div>

<p></p>

-- <br>
&nbsp;<br>
--- <br>
You received this message because you are subscribed to the Google Groups "=
ISO C++ Standard - Future Proposals" group.<br>
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"javascript:" target=3D"_blank" gdf-obfuscated-mailto=3D"=
yMFBNKkM8DMJ" onmousedown=3D"this.href=3D'javascript:';return true;" onclic=
k=3D"this.href=3D'javascript:';return true;">std-proposal...@<wbr>isocpp.or=
g</a>.<br>
To post to this group, send email to <a href=3D"javascript:" target=3D"_bla=
nk" gdf-obfuscated-mailto=3D"yMFBNKkM8DMJ" onmousedown=3D"this.href=3D'java=
script:';return true;" onclick=3D"this.href=3D'javascript:';return true;">s=
td-pr...@isocpp.org</a>.<br>
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/" target=3D"_blank" onmousedown=3D"this.href=3D'http://groups=
..google.com/a/isocpp.org/group/std-proposals/';return true;" onclick=3D"thi=
s.href=3D'http://groups.google.com/a/isocpp.org/group/std-proposals/';retur=
n true;">http://groups.google.com/a/<wbr>isocpp.org/group/std-<wbr>proposal=
s/</a>.<br>
</div></div></span></blockquote></div><span><br><br clear=3D"all"><div><br>=
</div>-- <br>Who=E2=80=99s got the sweetest disposition?<br>One guess, that=
=E2=80=99s who?<br>Who=E2=80=99d never, ever start an argument?<br>Who neve=
r shows a bit of temperament?<br>Who's never wrong but always right?<br>
Who'd never dream of starting a fight?<br>Who get stuck with all the bad lu=
ck?=20
</span></div></div><div><div>

<p></p>

-- <br>
&nbsp;<br>
--- <br>
You received this message because you are subscribed to the Google Groups "=
ISO C++ Standard - Future Proposals" group.<br>
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"javascript:" target=3D"_blank" gdf-obfuscated-mailto=3D"=
yMFBNKkM8DMJ" onmousedown=3D"this.href=3D'javascript:';return true;" onclic=
k=3D"this.href=3D'javascript:';return true;">std-proposal...@<wbr>isocpp.or=
g</a>.<br>
To post to this group, send email to <a href=3D"javascript:" target=3D"_bla=
nk" gdf-obfuscated-mailto=3D"yMFBNKkM8DMJ" onmousedown=3D"this.href=3D'java=
script:';return true;" onclick=3D"this.href=3D'javascript:';return true;">s=
td-pr...@isocpp.org</a>.<br>
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/" target=3D"_blank" onmousedown=3D"this.href=3D'http://groups=
..google.com/a/isocpp.org/group/std-proposals/';return true;" onclick=3D"thi=
s.href=3D'http://groups.google.com/a/isocpp.org/group/std-proposals/';retur=
n true;">http://groups.google.com/a/<wbr>isocpp.org/group/std-<wbr>proposal=
s/</a>.<br>
</div></div></blockquote></div><br></div></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_217_1200739447.1414166360021--

.
