How to set namespace?

Answered

Hello,

I am using clion 1.0

When adding a C++ class, it uses a template that includes the following:

${NAMESPACES_OPEN}

${NAMESPACES_CLOSE}

How do I set these? I don't see an option to set the namespace in the add class dialog Where do I set it?. Even better would be an option to set this on a project level, since my whole project will reside in the ame namespace. Is this possible?

3 comments
Comment actions Permalink

Hi Baruch.

NAMESPACES_OPEN/NAMESPACES_CLOSE variables are used in extract/move refactorings to preserve the code correctness.
When you create the new class, you can’t specify the outer namespace.
If you need to, please create issue in our tracker: http://youtrack.jetbrains.com/issues/CPP

0
Comment actions Permalink

Hello,

quite old, but still interesting for me.

${NAMESPACES_OPEN} is used in the "File and Code Templates" section "C++ Class Header". What sense does it have if it can only be used in refactoring and not when creating a new class?

I have the same question. Is it possible to set it somewhere?

1
Comment actions Permalink

Hi Alexander, feel free to comment or upvote https://youtrack.jetbrains.com/issue/CPP-4924.

0

Please sign in to leave a comment.