220 14195 <CAOU91OMHqxODvnzpHHSk_bgNUnAoFFqTUc5xTAB3xzUMMk5gkQ@mail.gmail.com> article
Path: news.gmane.org!not-for-mail
From: =?UTF-8?Q?Klaim_=2D_Jo=C3=ABl_Lamotte?= <mjklaim@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Re: Templetized namespaces
Date: Fri, 24 Oct 2014 13:48:04 +0200
Lines: 303
Approved: news@gmane.org
Message-ID: <CAOU91OMHqxODvnzpHHSk_bgNUnAoFFqTUc5xTAB3xzUMMk5gkQ@mail.gmail.com>
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>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: multipart/alternative; boundary=001a1139761cfe7aa7050629c0f2
X-Trace: ger.gmane.org 1414151293 22110 80.91.229.3 (24 Oct 2014 11:48:13 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Fri, 24 Oct 2014 11:48:13 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBD3NR2WQQ4IBB5XYVCRAKGQEN6JLSLY@isocpp.org Fri Oct 24 13:48:09 2014
Return-path: <std-proposals+bncBD3NR2WQQ4IBB5XYVCRAKGQEN6JLSLY@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-qg0-f70.google.com ([209.85.192.70])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBD3NR2WQQ4IBB5XYVCRAKGQEN6JLSLY@isocpp.org>)
	id 1XhdLk-0006E2-EH
	for gclcip-std-proposals@m.gmane.org; Fri, 24 Oct 2014 13:48:08 +0200
Original-Received: by mail-qg0-f70.google.com with SMTP id a108sf2404037qge.5
        for <gclcip-std-proposals@m.gmane.org>; Fri, 24 Oct 2014 04:48:07 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:mime-version:in-reply-to:references:date
         :message-id:subject:from:to:x-original-sender
         :x-original-authentication-results:reply-to:precedence:mailing-list
         :list-id:list-post:list-help:list-archive:list-subscribe
         :list-unsubscribe:content-type;
        bh=16sAD+g8RoNgbEpJju6YZJx+aES9CeTFU/hkbYRh6hk=;
        b=Ul0mEquMpT8ob5pXZm37lHLrjJsCkV1OW5dIYuCjjjaTnjJvi8equYlfCX89wU7GkH
         6AGhJoS0aC5D2aMuHhn2DPZ8OWVS3FamweM8omw65uWR1up0DjNayhmwm8E2hiScBrwa
         EUioSeAAK+GCCnkqYzT/FKd4q0eeHmdDvJOvK0AFtv0kTQc9obtBHxauCFkQP/jLtAt+
         KTNKzdlpttLUVeuTq6cajvl+M7ndJnNbOeEyA1Tfkuxi8w0lshI4kygMu3ED2Up3P4Q2
         tiwBVSH/LjGzQsLPj6AXlEzmtMlaeU/rJDX8esH62PxnyG/i1TlPiN0tc/f3Z8jExtuD
         2aVA==
X-Gm-Message-State: ALoCoQnZxO9342inj9bxqfepEUXvUupZ8h/i4F/L8aTF7SgnnfLsiBHNuWObUFUILAuutK8gMzR6
X-Received: by 10.236.70.137 with SMTP id p9mr7117641yhd.45.1414151287173;
        Fri, 24 Oct 2014 04:48:07 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.140.80.213 with SMTP id c79ls1686509qgd.56.gmail; Fri, 24 Oct
 2014 04:48:06 -0700 (PDT)
X-Received: by 10.236.230.40 with SMTP id i38mr4441072yhq.34.1414151286638;
        Fri, 24 Oct 2014 04:48:06 -0700 (PDT)
Original-Received: from mail-yh0-x22d.google.com (mail-yh0-x22d.google.com. [2607:f8b0:4002:c01::22d])
        by mx.google.com with ESMTPS id v44si4972336yhv.201.2014.10.24.04.48.06
        for <std-proposals@isocpp.org>
        (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128);
        Fri, 24 Oct 2014 04:48:06 -0700 (PDT)
Received-SPF: pass (google.com: domain of mjklaim@gmail.com designates 2607:f8b0:4002:c01::22d as permitted sender) client-ip=2607:f8b0:4002:c01::22d;
Original-Received: by mail-yh0-f45.google.com with SMTP id f73so349908yha.32
        for <std-proposals@isocpp.org>; Fri, 24 Oct 2014 04:48:06 -0700 (PDT)
X-Received: by 10.170.58.2 with SMTP id a2mr5969694yka.78.1414151284879; Fri,
 24 Oct 2014 04:48:04 -0700 (PDT)
Original-Received: by 10.76.132.136 with HTTP; Fri, 24 Oct 2014 04:48:04 -0700 (PDT)
In-Reply-To: <CAFdMc-1AbUTsE-mkvs0Sbcp7J4-_eb6epevLkXUBuGoNYUVgrg@mail.gmail.com>
X-Original-Sender: mjklaim@gmail.com
X-Original-Authentication-Results: mx.google.com;       spf=pass (google.com:
 domain of mjklaim@gmail.com designates 2607:f8b0:4002:c01::22d as permitted
 sender) smtp.mail=mjklaim@gmail.com;       dkim=pass header.i=@gmail.com;
       dmarc=pass (p=NONE dis=NONE) header.from=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: <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:14195
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/14195>

--001a1139761cfe7aa7050629c0f2
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

Sorry I didn't see your reply before.

On Sun, Jan 26, 2014 at 1:52 AM, dgutson . <danielgutson@gmail.com> wrote:

> On Wed, Jan 22, 2014 at 9:47 AM, Klaim - Jo=C3=ABl Lamotte <mjklaim@gmail=
..com>
> wrote:
>
>> I had the exact same ideas few months ago after finding myself doing
>> generic library which all types would depend on the same type,
>> and remarking how much duplication could be avoided if I was allowed to
>> specify that a whole bunch of types would automatically have an addition=
al
>> template parameter implicitly.
>>
>> namespace blah< typename X >
>> {
>>      class K {};
>>      template < class T > class U {};
>> }
>>
>> would be translated to
>>
>> 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 ar=
e
>> too different and not really encapsulating anything than names;
>>  2. there are a lot of potential issues related to the order of template
>> arguments;
>>
>
> Please elaborate about the last two points.
>
>

Basically, namespaces don't have a unique definition and are only affecting
naming.
Therefore, what would be better to template would be something like a
module or a class or a mixin (a class component).



>   3. there is a potential issue for reading the code as you need to see
>> the namespace declaration before being able to follow the rest of the co=
de.
>>
>
> I don't find this issue different than any other template declaration, fo=
r
> example a nested class of a template class.
>
>

Yes, it's a weak point but apparently some people have trouble with this.
Not sure if it should be taken into account.


>      What I mean here is basically the same argument that makes Clang
>> developers avoid anonymous namespaces.
>>
>> 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 types, using
>> another type as argument of the process to generate the wanted types.
>>
>
> We agree on that.
>
>
>>  Basically, I want one of the features that the Reflection group is
>> supposed to look for.
>>
>
> I'm working on statement-templates.googlecode.com but that's something I
> will post in this list later.
>
>
>>
>> Since that realization, I think that efforts should be put to have a new
>> reflection construct instead of making namespace do something too differ=
ent
>> from it's initial use.
>>
>>
>>
>>  --
>>
>> ---
>> You received this message because you are subscribed to the Google Group=
s
>> "ISO C++ Standard - Future Proposals" group.
>> To unsubscribe from this group and stop receiving emails from it, send a=
n
>> 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/.
>>
>
>
>
> --
> 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?
>
> --
>
> ---
> 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/.
>

--=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/.

--001a1139761cfe7aa7050629c0f2
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Sorry I didn&#39;t see your reply before.<br><div class=3D=
"gmail_extra"><br><div class=3D"gmail_quote">On Sun, Jan 26, 2014 at 1:52 A=
M, dgutson . <span dir=3D"ltr">&lt;<a href=3D"mailto:danielgutson@gmail.com=
" target=3D"_blank">danielgutson@gmail.com</a>&gt;</span> wrote:<br><blockq=
uote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc =
solid;padding-left:1ex"><div dir=3D"ltr"><div class=3D"gmail_extra"><div cl=
ass=3D"gmail_quote"><span class=3D"">On Wed, Jan 22, 2014 at 9:47 AM, Klaim=
 - Jo=C3=ABl Lamotte <span dir=3D"ltr">&lt;<a href=3D"mailto:mjklaim@gmail.=
com" target=3D"_blank">mjklaim@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 class=3D"gmail_extra">I had the exac=
t same ideas few months ago after finding myself doing generic library whic=
h all types would depend on the same type,</div>
<div class=3D"gmail_extra">and remarking how much duplication could be avoi=
ded if I was allowed to specify that a whole bunch of types would automatic=
ally have an additional template parameter implicitly.</div>
<div class=3D"gmail_extra"><br></div><div class=3D"gmail_extra">namespace b=
lah&lt; typename X &gt;</div><div class=3D"gmail_extra">{</div><div class=
=3D"gmail_extra">=C2=A0 =C2=A0 =C2=A0class K {};</div><div class=3D"gmail_e=
xtra">=C2=A0 =C2=A0 =C2=A0template &lt; class T &gt; class U {};</div>

<div class=3D"gmail_extra">}</div><div class=3D"gmail_extra"><br></div><div=
 class=3D"gmail_extra">would be translated to=C2=A0</div><div class=3D"gmai=
l_extra"><br></div><div class=3D"gmail_extra">namespace blah</div><div clas=
s=3D"gmail_extra">

{</div><div class=3D"gmail_extra">=C2=A0 =C2=A0 template&lt; typename X &gt=
;</div><div class=3D"gmail_extra">=C2=A0 =C2=A0 class K {};</div><div class=
=3D"gmail_extra">=C2=A0 =C2=A0 template&lt; typename X, class T &gt; class =
U {};</div><div class=3D"gmail_extra">

}</div><div class=3D"gmail_extra"><br></div><div class=3D"gmail_extra"><br>=
</div><div class=3D"gmail_extra">However, after weeks of thinking about thi=
s I concluded that:</div><div class=3D"gmail_extra"><br></div><div class=3D=
"gmail_extra">

=C2=A01. namespace are not the appropriate construct for this, they really =
are too different and not really encapsulating anything than names;</div><d=
iv class=3D"gmail_extra">=C2=A02. there are a lot of potential issues relat=
ed to the order of template arguments;</div>
</div></blockquote><div><br></div></span><div>Please elaborate about the la=
st two points.</div><span class=3D""><div>=C2=A0</div></span></div></div></=
div></blockquote><div><br></div><div>Basically, namespaces don&#39;t have a=
 unique definition and are only affecting naming.</div><div>Therefore, what=
 would be better to template would be something like a module or a class or=
 a mixin (a class component).</div><div><br></div><div>=C2=A0</div><blockqu=
ote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc s=
olid;padding-left:1ex"><div dir=3D"ltr"><div class=3D"gmail_extra"><div cla=
ss=3D"gmail_quote"><span class=3D""><blockquote class=3D"gmail_quote" style=
=3D"margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(20=
4,204,204);border-left-style:solid;padding-left:1ex">
<div dir=3D"ltr">
<div class=3D"gmail_extra">=C2=A03. there is a potential issue for reading =
the code as you need to see the namespace declaration before being able to =
follow the rest of the code.</div></div></blockquote><div><br></div></span>=
<div>I don&#39;t find this issue different than any other template declarat=
ion, for example a nested class of a template class.</div><span class=3D"">
<div>=C2=A0</div></span></div></div></div></blockquote><div><br></div><div>=
Yes, it&#39;s a weak point but apparently some people have trouble with thi=
s.</div><div>Not sure if it should be taken into account.</div><div>=C2=A0<=
/div><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-le=
ft:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr"><div class=3D"gmail_ex=
tra"><div class=3D"gmail_quote"><span class=3D""><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;padding-left:1ex"><div dir=
=3D"ltr"><div class=3D"gmail_extra">=C2=A0 =C2=A0 =C2=A0What I mean here is=
 basically the same argument that makes Clang developers avoid anonymous na=
mespaces.</div>

<div class=3D"gmail_extra"><br></div><div class=3D"gmail_extra">Also, I bel=
ieve that the real thing I do want when I&#39;m writing these generic libra=
ries is actually to generate a whole bunch of types, using another type as =
argument of the process to generate the wanted types.</div>
</div></blockquote><div><br></div></span><div>We agree on that.</div><span =
class=3D""><div>=C2=A0</div><blockquote class=3D"gmail_quote" style=3D"marg=
in:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,20=
4);border-left-style:solid;padding-left:1ex">
<div dir=3D"ltr">
<div class=3D"gmail_extra">Basically, I want one of the features that the R=
eflection group is supposed to look for.</div></div></blockquote><div><br><=
/div></span><div>I&#39;m working on=C2=A0<a href=3D"http://statement-templa=
tes.googlecode.com" target=3D"_blank">statement-templates.googlecode.com</a=
> but that&#39;s something I will post in this list later.</div>
<div>=C2=A0</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 class=3D""><div dir=3D"ltr"><div cl=
ass=3D"gmail_extra"><br></div>
<div class=3D"gmail_extra">Since that realization, I think that efforts sho=
uld be put to have a new reflection construct instead of making namespace d=
o something too different from it&#39;s initial use.</div>
<div class=3D"gmail_extra"><br></div><div class=3D"gmail_extra"><br></div><=
div class=3D"gmail_extra"><br></div></div></span><span class=3D""><div><div=
>

<p></p>

-- <br>
=C2=A0<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%2Bunsubscribe@isocpp.org" target=3D=
"_blank">std-proposals+unsubscribe@isocpp.org</a>.<br>
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org" target=3D"_blank">std-proposals@isocpp.org</a>.<br>
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/" target=3D"_blank">http://groups.google.com/a/isocpp.org/gro=
up/std-proposals/</a>.<br>
</div></div></span></blockquote></div><span class=3D""><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 never shows a bit of temperament?<br>Who&#39;s never wrong but alway=
s right?<br>
Who&#39;d never dream of starting a fight?<br>Who get stuck with all the ba=
d luck?=20
</span></div></div><div class=3D"HOEnZb"><div class=3D"h5">

<p></p>

-- <br>
=C2=A0<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%2Bunsubscribe@isocpp.org" target=3D=
"_blank">std-proposals+unsubscribe@isocpp.org</a>.<br>
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org" target=3D"_blank">std-proposals@isocpp.org</a>.<br>
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/" target=3D"_blank">http://groups.google.com/a/isocpp.org/gro=
up/std-proposals/</a>.<br>
</div></div></blockquote></div><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"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

--001a1139761cfe7aa7050629c0f2--

.
