Re: Define a larger code block
Tom Serface wrote:
:: What were we supposed to remember :o)
Two underscores in a row is reserved. Period.
Beginning with and underscore and uppercase letter is reserved.
Period.
Beginning with an underscore and lowercase letter is reserved in the
global namespace and in namespace std.
Add to this that the next C++ standard seems to reserve underscore
digit as a placeholder in bind expressions. Formally in a nested
namespace, but code will have to do a "using std::placeholders" to
make it work properly.
So, theoretically, you are allowed to use names beginning with
underscore lower case character in places other than namespace std and
the global namespace.
But before you do, please take a look at things like MS' tchar.h
header which has about 2000 #defines of names beginning with
underscore lowercase character. Seems like macros don't respect
namespaces, and will invade your code, even though they shouldn't.
Oops!
So, in practice, "Underscore at the beginning bad, two underscores in
a row bad."
Bo Persson
::
:: Tom
::
:: "Doug Harrison [MVP]" <dsh@mvps.org> wrote in message
:: news:4amaa35thd6nck8rpk3r96frra0vb6m9h0@4ax.com...
::: On Mon, 23 Jul 2007 17:26:34 -0500, "Ben Voigt [C++ MVP]"
::: <rbv@nospam.nospam> wrote:
:::
:::: Yet another Microsoft documentation bug.
:::
::: Yep. All most people need to remember is, "Underscore at the
::: beginning bad,
::: two underscores in a row bad." The first part is overstated a
::: tad, but IMO it's as much as any normal user can be expected to
::: remember.
:::
::: --
::: Doug Harrison
::: Visual C++ MVP