This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Optimization and template parms
- To: egcs at cygnus dot com
- Subject: Optimization and template parms
- From: Andrew Borthwick <borthwic at johnson dot cs dot nyu dot edu>
- Date: Mon, 2 Feb 1998 14:30:24 -0500 (EST)
Hi,
In the following method of a templated class:
template <bool c>
Foo<c>::f1() {
if (c) {cout << "true" << endl;}
else {cout << "false" << endl;}
}
Would I be correct to assume that after instantiating the template, egcs
wouldn't emit any code for the if/else test because the test always succeeds for
Foo<true> and fails for Foo<false>?
Thanks,
Andrew Borthwick