C++ sucks, or at least a little

by Maarten

Stumbled upon this cool comment in the Mozilla source code:

// C++ sucks! There's no way to do this with a macro,
// at least not that I know, if you know how to do
// this with a macro then please do so...
static const PRUnichar sHTMLTagUnicodeName_a[] =
{'a', '\0'};
static const PRUnichar sHTMLTagUnicodeName_abbr[] =
{'a', 'b', 'b', 'r', '\0'};
static const PRUnichar sHTMLTagUnicodeName_acronym[] =
{'a', 'c', 'r', 'o', 'n', 'y', 'm', '\0'};
static const PRUnichar sHTMLTagUnicodeName_address[] =
{'a', 'd', 'd', 'r', 'e', 's', 's', '\0'};
static const PRUnichar sHTMLTagUnicodeName_applet[] =
{'a', 'p', 'p', 'l', 'e', 't', '\0'}; 

He/she has got a point :)

Fork me on GitHub