On 17-1-2012 22:14, Johan Engelen wrote:
Hi all, I am busy 'improving' a small part of the code to use an underscore for class members. I think this helps fight bugs when converting C functions to class methods. For example, a SPPath function may define a temporary variable 'curve', but that one will hide the class's own 'curve' variable (inherited from SPShape). Since the class hierarchy is quite long at places, this is not so easily spotted. So I think the _* stuff for members is really nice and clarifies code a lot.
However, now I read in our codestyle document:
- Underscore as first character of identifiers Please consider that the C++ standard reserves _* identifiers
[17.4.3.1.2]: "Each name that begins with an underscore is reserved to the implementation for use as a name in the global namespace".
Or did I misinterpret, and does it mean that ::_* is reserved, but JohanClass::_hello is perfectly fine?
Thanks, Johan