A
Axter
Section 17.4.3.1.2 states that each name that begins with an underscore
is reserved to the implementation for use as a name in the global
namespace.
Exactly what defines the implementation?
Is it only narrowly defined by the compiler's internal name handling?
Or does it also include the library that comes with the compiler?
Does it include the OS library as part of the implementation?
I'm developing some portable leak tracking code, and for most functions
I can't use namespaces in the header because the code has to be able to
compile to both C and C++ source files.
I'm trying to determine what would be the best naming convention to
use, and I'm considering something like the following:
_leaktracker61_free
_leaktracker61_realloc
_leaktracker61_DumpAllLeaks
_leaktracker61_fopen
_leaktracker61_fclose
When compiled in DEBUG mode, these functions are going to be in the
global namespace, so I'm trying to limit name collision.
I'm wondering if I can consider my code as an extension to the
implementation, and there by use the leading underscore to avoid name
collision.
is reserved to the implementation for use as a name in the global
namespace.
Exactly what defines the implementation?
Is it only narrowly defined by the compiler's internal name handling?
Or does it also include the library that comes with the compiler?
Does it include the OS library as part of the implementation?
I'm developing some portable leak tracking code, and for most functions
I can't use namespaces in the header because the code has to be able to
compile to both C and C++ source files.
I'm trying to determine what would be the best naming convention to
use, and I'm considering something like the following:
_leaktracker61_free
_leaktracker61_realloc
_leaktracker61_DumpAllLeaks
_leaktracker61_fopen
_leaktracker61_fclose
When compiled in DEBUG mode, these functions are going to be in the
global namespace, so I'm trying to limit name collision.
I'm wondering if I can consider my code as an extension to the
implementation, and there by use the leading underscore to avoid name
collision.