473,397 Members | 2,116 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

namespace templates

Hello all,

I was just wondering why there are no namespace templates in C++. For
instance, something like this...

template <typename TYPE>
namespace SOME
{
TYPE *pointer;
}

I cannot think of any use of this sort of a construct. But since a
class name itself becomes a namespace and when I'd have only static
data in a class, I could make it a namespace template.

Pardon me if this whole question is stupid - I just wanted to know if
it was a language design decision to not include it or no one thought
about it or its utterly useless.

Thanks is advance.
Regards,
Srini

Jul 23 '05 #1
1 1115
ben
1. If anything in such a namespace is not supposed to be generic then you
are repeating unnecessarily.
2. You have to instantiate everything in such a namespace even if you are
just using a few of them.
3. Everything in such a namespace must accept the same argument list.

etc

"Srini" <sr*********@gmail.com> wrote in message
news:11********************@g44g2000cwa.googlegrou ps.com...
Hello all,

I was just wondering why there are no namespace templates in C++. For
instance, something like this...

template <typename TYPE>
namespace SOME
{
TYPE *pointer;
}

I cannot think of any use of this sort of a construct. But since a
class name itself becomes a namespace and when I'd have only static
data in a class, I could make it a namespace template.

Pardon me if this whole question is stupid - I just wanted to know if
it was a language design decision to not include it or no one thought
about it or its utterly useless.

Thanks is advance.
Regards,
Srini

Jul 23 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Brian Ross | last post by:
Hi, I am having a problem writing a constructor/member initialization with VC.NET7.1. Here is the code: --- namespace Library
1
by: CB | last post by:
I have a group of documents that previously had no schema, now I have a schema, and I want to use XSLT to fixup the documents by inserting the namespace reference. In other words, my input...
2
by: wooks | last post by:
I want to apply 2 changes to the following xml <ROOTSTUB app="appname"/> 1. change the app attribute to an element. 2. put the ROOTSTUB element into a namespace that is passed as a global...
6
by: insane79 | last post by:
Hi, i have one problem with an xsl trasformation (I'm using Xalan) The source XML document is the following: <?xml version = '1.0' encoding = 'ISO-8859-1'?> <ROOT...
3
by: Mike Dickens | last post by:
hi, i'm sure this has come up before but havn't managed to find an answer. if i have the following xslt <?xml version="1.0" encoding="ISO-8859-1"?> <xsl:stylesheet method="xml" version="1.0"...
5
by: Adam Barr | last post by:
I have a tag foo that I want to copy unchanged when it is a subtag of bar, so I have a template (x is the namespace for the document): <xsl:template match="x:bar/x:foo"> <xsl:copy>...
4
by: n.phelge | last post by:
I'm trying to validate XML which doesn't include a namespace, so I've written a schema and I'm attempting to add a namespace to the original XML using XSLT. The original XML looks like this: ...
7
by: Kai-Uwe Bux | last post by:
Hi folks, I observed something that puzzles me. When I do namespace xxx { using std::swap; } it appears that xxx::swap and std::swap are not strictly equivalent. In particular, I think...
1
by: chriscorbell | last post by:
I'm fairly new to XSLT and XPath. My question is related to some posts I found in group archives (e.g. "Disable XPath namespace matching in XSL") but is a little more specific. I want a single...
6
by: Jess | last post by:
Hello, I learned that we are not allowed to add any new templates or classes or functions or anything else to std namespace. Does it mean that "std" can never be extended? I can't even add any...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.