Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

VC 2005 died on template (part I)

2 views
Skip to first unread message

Alex

unread,
Mar 17, 2010, 6:22:28 AM3/17/10
to
template <int i> struct Factorial {
enum { N = i<=0? 1 : i*Factorial<i-1>::N };
};
template <> struct Factorial <-500> { enum { N = 1 }; };
const int factorial=Factorial<5>::N;

Jens Thoms Toerring

unread,
Mar 17, 2010, 7:34:54 AM3/17/10
to

If you want to discuss C++ you should post to comp.lang.c++ and
not comp.lang.c (which is for C, a different language). And if
your compiler is broken then you probably best talk to whoever
produced it since then it's not a laguage issue but a quality
of implementation issue.
Regards, Jens
--
\ Jens Thoms Toerring ___ j...@toerring.de
\__________________________ http://toerring.de

Richard Bos

unread,
Mar 17, 2010, 9:03:35 AM3/17/10
to
Alex <alexey.d...@gmail.com> wrote:

> template <int i> struct Factorial {

You want comp.lang.c++, down the hallway, second door to the right.

Richard

0 new messages