220 8691 <4cfc2db6-97da-4750-9296-5aaaa3475014@isocpp.org> article
Path: news.gmane.org!not-for-mail
From: Andrew Tomazos <andrewtomazos@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Templetized namespaces
Date: Sun, 19 Jan 2014 10:16:23 -0800 (PST)
Lines: 173
Approved: news@gmane.org
Message-ID: <4cfc2db6-97da-4750-9296-5aaaa3475014@isocpp.org>
References: <CAFdMc-214LLZ3GtZyd3rZ1MwM4Q0qaTZFZmkXuyDPVZDU6aJ=w@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_188_9001793.1390155383836"
X-Trace: ger.gmane.org 1390155378 17360 80.91.229.3 (19 Jan 2014 18:16:18 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Sun, 19 Jan 2014 18:16:18 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBD5KHQXXWYPRB6FM6CLAKGQEEZNL5BA@isocpp.org Sun Jan 19 19:16:26 2014
Return-path: <std-proposals+bncBD5KHQXXWYPRB6FM6CLAKGQEEZNL5BA@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+bncBD5KHQXXWYPRB6FM6CLAKGQEEZNL5BA@isocpp.org>)
	id 1W4wv3-0007Du-Lj
	for gclcip-std-proposals@m.gmane.org; Sun, 19 Jan 2014 19:16:25 +0100
Original-Received: by mail-vc0-f198.google.com with SMTP id lf12sf10320399vcb.9
        for <gclcip-std-proposals@m.gmane.org>; Sun, 19 Jan 2014 10:16:24 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20120113;
        h=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=kpax2Nl8A4jge+h6EWlX/vpFdaAGBFU/P7LkMl/E6lI=;
        b=LKyLHTxa9HG+5b/3aEaqcMGSe8PDV+XdUdD3am+t7wYXiriTYHcLaMBhYl+bCRZxzk
         QveFC0SO8o5VH9/ukoWISw7/+6WG7PCMlDa+4FAELP15ZTSn1aJX2NeafRbmEAfBRuen
         Q9cWZ5vSxbmwlZYAjDrDv1MhqnSp/vI5iBH/tQ4Jma2aw26khQVNdvLMFrdmgt2Xn3aG
         4RFeVqNMe4ZCbgA8DzFunhS8NcFM3iNq3Mmr70OI32VdrSqgLQXsR5y2D+PR0M/D213d
         LxVVBy3ynp+lz7F8KGvDoXrYv20PxlQDiC5Xv0cuZT4qBrlQ78o4Q+TwiROCJuGqxfwV
         N65A==
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=kpax2Nl8A4jge+h6EWlX/vpFdaAGBFU/P7LkMl/E6lI=;
        b=JL2/EVlb7J47joPJ1YiE9sBNATKiclaJSNBimGzPS2ZE1xc5vHHCL/U/WRhcDtIF9B
         RXrjM2Wk9qwSOL1FPtAE00Wqrpoqrh7dcNAPQwDaBuKOJic63MQc0G4sLtZJ67R7CwDo
         PHmKHTJbbIrm2xuebz6l97pbxP9se0iGzYlMkaQVe9ZpqMaW9ewYg3ZoUN0PzXw1n6k5
         NZ/+j6DgbemkeoVEQTyD1/FbgwSsXbDmaxyxyj2GGryRsVUwgG4wp/vgnqZL24uIc4yQ
         EpNmCe9lJyDcb+nvPx/RdurCMs7RGGpTF6mbZIubzjbNI8qjjjsGVrm0E10bDtoPXUGr
         Mv3w==
X-Gm-Message-State: ALoCoQmXveszsomU+jbYylTJz/WbaRFXk1YUvYB1bPfnVQz+KfR/uFXVg1o+fpDVJOSrjZDYQy/5
X-Received: by 10.58.23.137 with SMTP id m9mr5088368vef.13.1390155384821;
        Sun, 19 Jan 2014 10:16:24 -0800 (PST)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.49.81.102 with SMTP id z6ls1559442qex.97.gmail; Sun, 19 Jan
 2014 10:16:24 -0800 (PST)
X-Received: by 10.140.95.144 with SMTP id i16mr342127qge.1.1390155384348;
        Sun, 19 Jan 2014 10:16:24 -0800 (PST)
In-Reply-To: <CAFdMc-214LLZ3GtZyd3rZ1MwM4Q0qaTZFZmkXuyDPVZDU6aJ=w@mail.gmail.com>
X-Original-Sender: andrewtomazos@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:8691
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/8691>

------=_Part_188_9001793.1390155383836
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

Namespaces differ from classes in that they can be split within and amongst=
=20
translation units.  The definition of a namespace is not required to be the=
=20
same in different translation units.  Multiple namespace definitions of the=
=20
same namespace in the same translation unit are logically merged into one=
=20
(the first is called the original, the following are called extensions).

How do template namespace specialization and template namespace=20
instantiation interact with these new properties that are not present in=20
other template entities?

Also namespaces can contain the following declarations, whereas classes=20
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,=
=20
how are they handled?

Also you need to think about program initialization.  The members of a=20
namespace have a bunch of rules about when they are initialized and in what=
=20
order.  How will these rules interact with template namespace instances?

The best approach for this type of feature would be to put together an=20
experimental compiler extension to gcc or clang that implements template=20
namespaces.  This would shake out all the above issues (and likely more)=20
which you could then use as the basis of a proposal.

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=20
> namespaces would be very useful.
>
> My latest use case is this: I'm writing a library that is configured=20
> through a number of (non-type) template arguments. Such configuration=20
> affects to all the classes of the library. To be more specific, it's a=20
> fault-tolerant library for the aerospace industry where the whole library=
=20
> is tuned with some integers (some of then related to redundancy due to=20
> ionizing radiation).
>
> The most natural thing would be to put all the classes in a namespace, an=
d=20
> let the namespace be templetized with such arguments.
> Moreover, a using namespace with the appropriate arguments would suffice=
=20
> 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.
>
> Thanks,
>
>    Daniel.
>
> ps: The library will be available soon and uses template metaprogramming=
=20
> based on the arguments.
>
>
> --=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
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_188_9001793.1390155383836
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Namespaces differ from classes in that they can be split w=
ithin and amongst translation units. &nbsp;The definition of a namespace is=
 not required to be the same in different translation units. &nbsp;Multiple=
 namespace definitions of the same namespace in the same translation unit a=
re logically merged into one (the first is called the original, the followi=
ng are called extensions).<div><br></div><div>How do template namespace spe=
cialization and template namespace instantiation interact with these new pr=
operties that are not present in other template entities?</div><div><br></d=
iv><div>Also namespaces can contain the following declarations, whereas cla=
sses cannot:</div><div><br></div><div><div>explicit-instantiation<br></div>=
<div>explicit-specialization</div><div>linkage-speci=EF=AC=81cation</div><d=
iv>namespace-de=EF=AC=81nition</div><div>attribute-declaration<br></div><di=
v>asm-de=EF=AC=81nition<br></div><div>namespace-alias-de=EF=AC=81nition</di=
v><div>using-directive<br></div><div>opaque-enum-declaration<br></div></div=
><div><br></div><div>Now that all these are possible member declarations of=
 a template entity, how are they handled?</div><div><br></div><div>Also you=
 need to think about program initialization. &nbsp;The members of a namespa=
ce have a bunch of rules about when they are initialized and in what order.=
 &nbsp;How will these rules interact with template namespace instances?</di=
v><div><br></div><div>The best approach for this type of feature would be t=
o put together an experimental compiler extension to gcc or clang that impl=
ements template namespaces. &nbsp;This would shake out all the above issues=
 (and likely more) which you could then use as the basis of a proposal.</di=
v><div><br></div><div>On Sunday, January 19, 2014 6:26:57 PM UTC+1, dgutson=
 . wrote:<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>&nbsp; &nbsp;I found a number of situations where the ab=
ility to templetize namespaces would be very useful.</div><div><br></div><d=
iv>My latest use case is this: I'm writing a library that is configured thr=
ough 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-tolera=
nt library for the aerospace industry where the whole library is tuned with=
 some integers (some of then related to redundancy due to ionizing radiatio=
n).</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>&nbsp; &nbsp; using namespace TheLibrary&lt;arg1, arg2,=
 arg3&gt;;</div><div><br></div><div>I didn't write the proposal yet, since =
I'd like to get some feedback.</div><div><br></div><div>Thanks,</div><div>
<br></div><div>&nbsp; &nbsp;Daniel.</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's never wrong but alway=
s right?<br>Who'd never dream of starting a fight?<br>Who get stuck with al=
l the bad luck?=20
</div></div>
</blockquote></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 />

------=_Part_188_9001793.1390155383836--

.
