From: Logan Capaldo Date: 2006-03-02T06:49:26+09:00 Subject: Re: :-( On Mar 1, 2006, at 10:00 AM, Anthony DeRobertis wrote: > Joe Van Dyk wrote: > >> 1. Templates (that aren't in the STL) scare me. > > #include > > template struct Factorial { > static const int F = i * Factorial::F; > }; > > template<> struct Factorial<1> { > static const int F = 1; > }; > > int main() { > std::cout << Factorial<5>::F << std::endl; > return 0; > } > > Now that wasn't so scary, right? Mine compiles faster: #include int main( ) { std::cout << 120 << std::endl; }