// Example of code that requires use of ANSI keyword typename. // By default, KCC will infer where the keyword typename should be. // // Here are sample commands that will compile the code: // // KCC typename.C // KCC --no_implicit_typename typename.C // // Here are sample commands that reject the code according to ANSI rules: // // KCC --strict typename.C // KCC --strict --implicit_typename typename.C template class Foo { public: // Without the keyword typename, the ANSI rules require that // the qualified identifer T::A is not the name of a type, // because it is dependent upon a template paramter. // // The comment shows where the ANSI rules require the keyword typename. typedef /*typename*/ T::A type; }; class Trait { public: typedef int A; }; main() { Foo foo; }