This code is still accepted by gcc version 4.2.0 20060306
(experimental). icc 8.1 rejects it. Check gcc's bugzilla for existing
PRs.
Regards,
Ryan Mansfield
___
help-gplusplus mailing list
help-gplusplus@gnu.org
http://lists.gnu.org/mailman/listinfo/h
The problem is because static data members need to be defined exactly
once in every translation unit. Please see
http://www.parashift.com/c++-faq-lite/ctors.html#faq-10.11
Regards,
Ryan Mansfield
___
help-gplusplus mailing list
help-gplusplus@gnu.org
Yes, you're right. Thank you for correcting me. I meant to say was that
they can only be defined exactly once. I need more coffee.
Regards,
Ryan Mansfield
___
help-gplusplus mailing list
help-gplusplus@gnu.org
http://lists.gnu.org/mailman/listinfo/help
Sorry if I don't correctly understand your problem. Are you trying to
do something like the following?
#define x(y) (#y)
int main() {
char buf[100] = x(TemplateClass);
printf("%s\n", buf);
}
If you're relying on old preproccesor behavior, you could try to
-traditional-cpp.
You should comp
Please read:
http://gcc.gnu.org/ml/gcc/2006-01/msg00015.html
Regards,
Ryan Mansfield
___
help-gplusplus mailing list
help-gplusplus@gnu.org
http://lists.gnu.org/mailman/listinfo/help-gplusplus
Peng,
The space between the ++ and i is fine. Some find ++i more readable,
that is all.
It is difficult to optimize away the repeated f(n) calls because f()
could have side effects and there is no guarantee it will always return
a constant. If f() always returns a constant, this could potentially
If you're doing more powerful optimizations, such as IPA based, its
likely you will be doing loop unrolling as well. And after loop
unrolling, they should generate code identical code.
> Saves usually a register and replaces a check against an 'arbitrary'
> number with a check for zero (which is f
> Funny. Last time I looked there was no cmpl in this case.
That's because you are using predecrement in this example. It changes
the test completely. With predecrement you only iterate the loop 4
times, and iterate 5 times with post decrement. Since it is
postdecrement, it needs the compare the
Why do you need unique guards? The reason why header guards are used is
to prevent multiple inclusion of a file so the macros are based on the
file name.
For example, foo.h would have:
#ifndef FOO_H
#define FOO_H
#endif
Sorry if this isn't very helpful, but I don't see why you would need
unique
Ah, files with the same name -- sorry, I should of thought of that. To
work around this problem, I'd probably just prefix the filename with
the namespace or folder name.
I can't think of an elegant solution. Maybe someone else has come up
with a clever naming convention for header guards...
Regar
10 matches
Mail list logo