This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/13879] Error when doing an explicit specilization within a class
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 28 Jan 2004 06:05:42 -0000
- Subject: [Bug c++/13879] Error when doing an explicit specilization within a class
- References: <20040127093124.13879.lifshitz@post.tau.ac.il>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From pinskia at gcc dot gnu dot org 2004-01-28 06:05 -------
Do this instead:
#include <stdio.h>
class Test {
public:
template<const int n>
struct Fact;
void Print();
};
template<const int n>
struct Test::Fact
{
enum {RET = Fact<n-1>::RET*n};
};
template<>
struct Test::Fact<0>
{
enum{RET = 1};
};
void Test::Print()
{
printf("Fact<7>=%d\n", Fact<7>::RET);
}
int main()
{
Test t;
t.Print();
return 0;
}
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13879