This is the mail archive of the gcc-bugs@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]
Other format: [Raw text]

[Bug c++/13879] Error when doing an explicit specilization within a class


------- 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


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