Quote:Original post by JohnBolton
I haven't decided how to prefix variables declared in a namespace.
I'd say n_, but that's quite close to m_. How about ns_? Should be clear enough.
Quote:Original post by JohnBolton
I haven't decided how to prefix variables declared in a namespace.
Quote:Original post by JohnBoltonWith the namespace name followed by the scope resolution operator?
I haven't decided how to prefix variables declared in a namespace.
Quote:Original post by Russell
In C++ you shouldn't prefix anything with an underscore (ex. _var). Postfixing an underscore is fine (ex. var_).
Quote:Original post by SneftelQuote:Original post by JohnBoltonWith the namespace name followed by the scope resolution operator?
I haven't decided how to prefix variables declared in a namespace.
Quote:Original post by Machinoid
So, what about prefixing private methods?
m_DoSomething( radius );
Quote:Original post by SneftelDoes that actually work? With the " : x(x), y(y)" initializer list thing going on? If so, yet another thing I've learned from this wonderful board...
C'mon, guys. Remember your C++. It's all about initializer lists.
*** Source Snippet Removed ***
Quote:Original post by Evil SteveQuote:Original post by Russell
In C++ you shouldn't prefix anything with an underscore (ex. _var). Postfixing an underscore is fine (ex. var_).
Prefixing something with only an underscore implies that its compiler specific (for those who were going to say "why not" :P), but so long as its clear, I don't see a paroblem with it. For something as simple as a constructor, it should be fine.
Quote:Original post by AgonyYes it does. Since initializer lists only initialize member variables, those are the only variables in scope when resolving the target to be initialized. However, the argument to each constructor follows normal resolution rules, so local variables take precedence over member variables.
Does that actually work? With the " : x(x), y(y)" initializer list thing going on?