220 8750 <CAOfiQqk_g0nwNP1TZndqrvmBAtqjhXsC0bAFax0nXwCPvwDw6g@mail.gmail.com> article
Path: news.gmane.org!not-for-mail
From: Richard Smith <richard@metafoo.co.uk>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Re: Templetized namespaces
Date: Tue, 21 Jan 2014 15:54:18 -0800
Lines: 236
Approved: news@gmane.org
Message-ID: <CAOfiQqk_g0nwNP1TZndqrvmBAtqjhXsC0bAFax0nXwCPvwDw6g@mail.gmail.com>
References: <CAFdMc-214LLZ3GtZyd3rZ1MwM4Q0qaTZFZmkXuyDPVZDU6aJ=w@mail.gmail.com>
	<4cfc2db6-97da-4750-9296-5aaaa3475014@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: multipart/alternative; boundary=047d7b3a946afc011604f083b9b9
X-Trace: ger.gmane.org 1390348457 9810 80.91.229.3 (21 Jan 2014 23:54:17 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Tue, 21 Jan 2014 23:54:17 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBDVNBJG4YAIBBK4R7SLAKGQEW5ND5NQ@isocpp.org Wed Jan 22 00:54:21 2014
Return-path: <std-proposals+bncBDVNBJG4YAIBBK4R7SLAKGQEW5ND5NQ@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-vc0-f198.google.com ([209.85.220.198])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBDVNBJG4YAIBBK4R7SLAKGQEW5ND5NQ@isocpp.org>)
	id 1W5l9B-00062a-0G
	for gclcip-std-proposals@m.gmane.org; Wed, 22 Jan 2014 00:54:21 +0100
Original-Received: by mail-vc0-f198.google.com with SMTP id lf12sf14634863vcb.5
        for <gclcip-std-proposals@m.gmane.org>; Tue, 21 Jan 2014 15:54:20 -0800 (PST)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:mime-version:sender: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=crg79WQ9Q3Kd8aMNENXASl9r3uafHNNyl6JK1fV6hYA=;
        b=e9kPLCX5xlslZHyOBvI/GTEU+e5VkeRqaW79uzsfucwNS557sqDsmeYfxOr6UyUzha
         Qcxz4tFzWGsJ6X4axGI//1o8KWv0+lLW477ZTF2ATg4RKw18aLhqIYKlOqZJDNVEWCRV
         bI2pFZmzFDvQbihE1487sJFtz+5oQYdzL9EWpjUif8PIu+KqqcHHEntM/FfZEJiePmpM
         s6SGasaz71+f4XNJKgOwxmaCKHxeNtlRfMXiPgkJtV7h/8E+1rzLVS4zZyYXbKDGwPaO
         1oXtsnv9eJXafCXQIOSItyBwG+/9a2jAsFRfZo/GZ65LDHydIDPOBKPl3GDbe2omSq2w
         8YaA==
X-Gm-Message-State: ALoCoQn9xogR+74AkDYT/TtwUY/JDvVjL04wvo2gw9AZ3vz5ES8+KvM8zoTE+Xim3ivs8clLIpPe
X-Received: by 10.236.139.116 with SMTP id b80mr8256515yhj.30.1390348460188;
        Tue, 21 Jan 2014 15:54:20 -0800 (PST)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.140.34.76 with SMTP id k70ls1307148qgk.30.gmail; Tue, 21 Jan
 2014 15:54:19 -0800 (PST)
X-Received: by 10.236.26.17 with SMTP id b17mr16435471yha.77.1390348459658;
        Tue, 21 Jan 2014 15:54:19 -0800 (PST)
Original-Received: from mail-vb0-x232.google.com (mail-vb0-x232.google.com [2607:f8b0:400c:c02::232])
        by mx.google.com with ESMTPS id s6si8082998yho.64.2014.01.21.15.54.18
        for <std-proposals@isocpp.org>
        (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128);
        Tue, 21 Jan 2014 15:54:18 -0800 (PST)
Received-SPF: pass (google.com: domain of metafoo@gmail.com designates 2607:f8b0:400c:c02::232 as permitted sender) client-ip=2607:f8b0:400c:c02::232;
Original-Received: by mail-vb0-f50.google.com with SMTP id w8so4046991vbj.9
        for <std-proposals@isocpp.org>; Tue, 21 Jan 2014 15:54:18 -0800 (PST)
X-Received: by 10.220.164.80 with SMTP id d16mr15858959vcy.15.1390348458523;
 Tue, 21 Jan 2014 15:54:18 -0800 (PST)
Original-Sender: metafoo@gmail.com
Original-Received: by 10.58.136.227 with HTTP; Tue, 21 Jan 2014 15:54:18 -0800 (PST)
In-Reply-To: <4cfc2db6-97da-4750-9296-5aaaa3475014@isocpp.org>
X-Original-Sender: richard@metafoo.co.uk
X-Original-Authentication-Results: mx.google.com;       spf=pass (google.com:
 domain of metafoo@gmail.com designates 2607:f8b0:400c:c02::232 as permitted
 sender) smtp.mail=metafoo@gmail.com;       dkim=pass header.i=@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: <http://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>,
 <mailto:googlegroups-manage+399137483710+unsubscribe@googlegroups.com>
Xref: news.gmane.org gmane.comp.lang.c++.isocpp.proposals:8750
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/8750>

--047d7b3a946afc011604f083b9b9
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

On Sun, Jan 19, 2014 at 10:16 AM, Andrew Tomazos <andrewtomazos@gmail.com>w=
rote:

> Namespaces differ from classes in that they can be split within and
> amongst translation units.  The definition of a namespace is not required
> to be the same in different translation units.  Multiple namespace
> definitions of the same namespace in the same translation unit are
> logically merged into one (the first is called the original, the followin=
g
> are called extensions).
>
> How do template namespace specialization and template namespace
> instantiation interact with these new properties that are not present in
> other template entities?
>
> Also namespaces can contain the following declarations, whereas classes
> cannot:
>
> explicit-instantiation
> explicit-specialization
> linkage-speci=EF=AC=81cation
> namespace-de=EF=AC=81nition
> attribute-declaration
> asm-de=EF=AC=81nition
> namespace-alias-de=EF=AC=81nition
> using-directive
> opaque-enum-declaration
>
> Now that all these are possible member declarations of a template entity,
> how are they handled?
>
> Also you need to think about program initialization.  The members of a
> namespace have a bunch of rules about when they are initialized and in wh=
at
> order.  How will these rules interact with template namespace instances?
>
> The best approach for this type of feature would be to put together an
> experimental compiler extension to gcc or clang that implements template
> namespaces.  This would shake out all the above issues (and likely more)
> which you could then use as the basis of a proposal.
>

In addition to the above list, a proposal on this would need to consider
whether namespace templates could support explicit specializations, partial
specializations, and explicit instantiations (both for themselves and for
their members).


> On Sunday, January 19, 2014 6:26:57 PM UTC+1, dgutson . wrote:
>>
>> Hi.
>>
>>    I found a number of situations where the ability to templetize
>> namespaces would be very useful.
>>
>> My latest use case is this: I'm writing a library that is configured
>> through a number of (non-type) template arguments. Such configuration
>> affects to all the classes of the library. To be more specific, it's a
>> fault-tolerant library for the aerospace industry where the whole librar=
y
>> is tuned with some integers (some of then related to redundancy due to
>> ionizing radiation).
>>
>> The most natural thing would be to put all the classes in a namespace,
>> and let the namespace be templetized with such arguments.
>> Moreover, a using namespace with the appropriate arguments would suffice
>> for all the application. For example:
>>
>>     using namespace TheLibrary<arg1, arg2, arg3>;
>>
>> I didn't write the proposal yet, since I'd like to get some feedback.
>>
>
I think this feature would have value, and seems worth putting before the
committee.


> Thanks,
>>
>>    Daniel.
>>
>> ps: The library will be available soon and uses template metaprogramming
>> based on the arguments.
>>
>>
>> --
>> 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/.

--047d7b3a946afc011604f083b9b9
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div class=3D"gmail_extra"><div class=3D"gmail_quote">On S=
un, Jan 19, 2014 at 10:16 AM, Andrew Tomazos <span dir=3D"ltr">&lt;<a href=
=3D"mailto:andrewtomazos@gmail.com" target=3D"_blank">andrewtomazos@gmail.c=
om</a>&gt;</span> wrote:<br>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex"><div dir=3D"ltr">Namespaces differ from clas=
ses in that they can be split within and amongst translation units. =C2=A0T=
he definition of a namespace is not required to be the same in different tr=
anslation units. =C2=A0Multiple namespace definitions of the same namespace=
 in the same translation unit are logically merged into one (the first is c=
alled the original, the following are called extensions).<div>
<br></div><div>How do template namespace specialization and template namesp=
ace instantiation interact with these new properties that are not present i=
n other template entities?</div><div><br></div><div>Also namespaces can con=
tain the following declarations, whereas classes cannot:</div>
<div><br></div><div><div>explicit-instantiation<br></div><div>explicit-spec=
ialization</div><div>linkage-speci=EF=AC=81cation</div><div>namespace-de=EF=
=AC=81nition</div><div>attribute-declaration<br></div><div>asm-de=EF=AC=81n=
ition<br></div><div>
namespace-alias-de=EF=AC=81nition</div><div>using-directive<br></div><div>o=
paque-enum-declaration<br></div></div><div><br></div><div>Now that all thes=
e are possible member declarations of a template entity, how are they handl=
ed?</div>
<div><br></div><div>Also you need to think about program initialization. =
=C2=A0The members of a namespace have a bunch of rules about when they are =
initialized and in what order. =C2=A0How will these rules interact with tem=
plate namespace instances?</div>
<div><br></div><div>The best approach for this type of feature would be to =
put together an experimental compiler extension to gcc or clang that implem=
ents template namespaces. =C2=A0This would shake out all the above issues (=
and likely more) which you could then use as the basis of a proposal.</div>
</div></blockquote><div><br></div><div>In addition to the above list, a pro=
posal on this would need to consider whether namespace templates could supp=
ort explicit specializations, partial specializations, and explicit instant=
iations (both for themselves and for their members).</div>
<div>=C2=A0</div><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8=
ex;border-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr"><div><div =
class=3D"h5"><div>On Sunday, January 19, 2014 6:26:57 PM UTC+1, dgutson . w=
rote:<blockquote class=3D"gmail_quote" style=3D"margin:0;margin-left:0.8ex;=
border-left:1px #ccc solid;padding-left:1ex">
<div dir=3D"ltr">Hi.<div><br></div><div>=C2=A0 =C2=A0I found a number of si=
tuations where the ability to templetize namespaces would be very useful.</=
div><div><br></div><div>My latest use case is this: I&#39;m writing a libra=
ry that is configured through a number of (non-type) template arguments. Su=
ch configuration affects to all the classes of the library. To be more spec=
ific, it&#39;s a fault-tolerant library for the aerospace industry where th=
e whole library is tuned with some integers (some of then related to redund=
ancy due to ionizing radiation).</div>

<div><br></div><div>The most natural thing would be to put all the classes =
in a namespace, and let the namespace be templetized with such arguments.</=
div><div>Moreover, a using namespace with the appropriate arguments would s=
uffice for all the application. For example:</div>

<div><br></div><div>=C2=A0 =C2=A0 using namespace TheLibrary&lt;arg1, arg2,=
 arg3&gt;;</div><div><br></div><div>I didn&#39;t write the proposal yet, si=
nce I&#39;d like to get some feedback.</div></div></blockquote></div></div>=
</div>
</div></blockquote><div><br></div><div>I think this feature would have valu=
e, and seems worth putting before the committee.</div><div>=C2=A0</div><blo=
ckquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #c=
cc solid;padding-left:1ex">
<div dir=3D"ltr"><div><div class=3D"h5"><div><blockquote class=3D"gmail_quo=
te" style=3D"margin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-=
left:1ex"><div dir=3D"ltr"><div>Thanks,</div><div>
<br></div><div>=C2=A0 =C2=A0Daniel.</div><div><br></div><div>ps: The librar=
y will be available soon and uses template metaprogramming based on the arg=
uments.</div><div><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 argume=
nt?<br>Who never shows a bit of temperament?<br>Who&#39;s never wrong but a=
lways right?<br>Who&#39;d never dream of starting a fight?<br>Who get stuck=
 with all the bad luck?=20
</div></div>
</blockquote></div></div></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 />
&nbsp;<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 std-proposals+unsubscribe@isocpp.org.<br />
To post to this group, send email to std-proposals@isocpp.org.<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 />

--047d7b3a946afc011604f083b9b9--

.
