This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Optimization and template parms


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



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]