[GiNaC-list] Include Guards
C.Dams at science.ru.nl
Fri Jan 21 10:38:03 CET 2005
On Thu, 20 Jan 2005, Jason Dusek wrote:
> // <Evil.h>
> #include <one_of_everything>
> class Evil
> static symbol x("x");
Not allowed: should be "static symbol x;" and "symbol Evil::x("x");"
somewhere outside your class.
> void showMeTheEvil()
> cout << x;
cout << x << endl; or perhaps some people may never see the output. Also
missing closing brace.
> I am fine with OO evil - making a global symbol server class, for
> example - but I can brook no other evil!
Possible, but do you really like to type Evil::x every time you need x?
What I sometimes do is to do all my calculations in the member functions
of some class. Memeber funcions can access variables like x without having
to write thinks like Evil::x or evil.x. In that case, I usually do not
make these variables static, since there will usually only be one copy of
that particular class anyway, so it does not matter.
More information about the GiNaC-list