Re: template and static methods
On Apr 22, 12:13 pm, Juha Nieminen <nos...@thanks.invalid> wrote:
red floyd wrote:
Change your include guard to something like SORTING_HPP_
In fact, it's highly recommended that the include guard
preprocessor identifier be more unique.
Since the preprocessor identifier is never actually *used*
anywhere for anything (other than for its role as an inclusion
guard in the two preprocessor lines at the beginning of the
file), there's no need to make it readable or logical in any
way. It's better to make this identifier overly long and
obfuscated than short and readable. (It wouldn't be the first
time that two different headers in two different libraries use
the *same* inclusion guard identifier, causing very hard to
trace odd compiler errors when both libraries are used,
especially if they are used through multiple layers of
indirection.)
I might add that you should never have to type the include guard
anyway. Just configure your editor to insert it automatically
any time you open a new .hh (or .hpp, or whatever) file, just
like you do to get the copyright notices and stuff in the code.
(This is trivial with vim and emacs, but I imagine any decent
editor would support it.)
(Under Unix, I use
guard3=` dd bs=24 count=1 if=/dev/random 2> /dev/null |
tr '\000-\377' "${alnum}${alnum}${alnum}${alnum}0-7" `
to get the random part---I got this particular solution from
Gennaro Prota; I was using a considerably more complicated
version using od and awk before.)
--
James Kanze (GABI Software) email:james.kanze@gmail.com
Conseils en informatique orient=E9e objet/
Beratung in objektorientierter Datenverarbeitung
9 place S=E9mard, 78210 St.-Cyr-l'=C9cole, France, +33 (0)1 30 23 00 34