namespace templates

S

Srini

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
 
B

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,294
Messages
2,571,511
Members
48,206
Latest member
EpifaniaMc

Latest Threads

Top