468,456 Members | 1,817 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,456 developers. It's quick & easy.

unnamed namespace,

I just want to clarify: Say I have a helper class that is only used in one
translation file (e.g., a predicate class). I don't want the name of this
class to conflict with other class names in other files, so I put it in a
nameless namespace?
Jul 2 '06 #1
1 1810
vsgdp wrote:
I just want to clarify: Say I have a helper class that is only used
in one translation file (e.g., a predicate class). I don't want the
name of this class to conflict with other class names in other files,
so I put it in a nameless namespace?
That's one very important use for unnamed namespaces, yes. Generally,
anything you think of putting in the global scope (or any other scope
that transcends a single translation unit), but don't want to be easily
visible in another translation unit, or potentially conflict with some
other name, belongs in unnamed namespace.

V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask
Jul 2 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Anthony | last post: by
1 post views Thread by marco_segurini | last post: by
1 post views Thread by Marco Jez | last post: by
3 posts views Thread by Sandy | last post: by
2 posts views Thread by dioscuroi | last post: by
9 posts views Thread by Ivan Mascovich | last post: by
3 posts views Thread by Tomás | last post: by
9 posts views Thread by Tom Plunket | last post: by
3 posts views Thread by CrazyJohn | last post: by
1 post views Thread by subhajit12345 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.