0

In all the new IDEs when using open and close curly brackets the auto-formatting usually indents, and uses the extendable block (with the + sign) even if it is not necessary.
For example, I like when all my functions have there own little extendable block but when I place them all in a namespace it makes unnecessary indent and my functions no-longer have the block i.e.

namespace my {
    int myfunc() {
        code
        more code
    }
}

instead of preferred version --

namespace my {
int myfunc() {
    code
    more code
}
}

It always bothered me, but now I randomly thought of a solution, using defines!

#define OPENBRACKET {
#define CLOSEBRACKET }

namespace my OPENBRACKET
int myfunc() {
   code
   more code
    }
CLOSEBRACKET

I was so happy, I had to share it with someone :D.
P.S. I love the C-styled #defines :icon_evil:

3
Contributors
2
Replies
4
Views
5 Years
Discussion Span
Last Post by dospy
1

or you can write the namespace contents and than wrap it all in the namespace u wanted

Votes + Comments
good idea
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.