C
cmwong2
Hi,
I'm trying to use Boost and find that my program doesn't compile in AIX
with VisualAge C++ 6. I tried to simulate the problem by writing a
simple program (see below) and find that it also didn't compile. The
error was "non-type template parameter must be constant integral
expression" in the line "A<f> a;". Is this a bug in VisualAge C++ 6? Is
there any patch available? Thanks.
CM
#include <stdio.h>
template<bool x>
class A
{
public:
void print()
{
printf("%d\n",x);
}
};
template<int n>
class B
{
public:
static const bool f=true;
A<f> a;
void print()
{
a.print();
printf("%d\n", n);
}
};
int main()
{
B<34> b;
b.print();
}
I'm trying to use Boost and find that my program doesn't compile in AIX
with VisualAge C++ 6. I tried to simulate the problem by writing a
simple program (see below) and find that it also didn't compile. The
error was "non-type template parameter must be constant integral
expression" in the line "A<f> a;". Is this a bug in VisualAge C++ 6? Is
there any patch available? Thanks.
CM
#include <stdio.h>
template<bool x>
class A
{
public:
void print()
{
printf("%d\n",x);
}
};
template<int n>
class B
{
public:
static const bool f=true;
A<f> a;
void print()
{
a.print();
printf("%d\n", n);
}
};
int main()
{
B<34> b;
b.print();
}