M
Michael Krause
Hello group,
I was wondering, is there anything in this short snippet of code that
violates some C++ standard?
-- cut here --
static void
f (double *z)
{
}
template <class T>
static void g (T *y)
{
f(y);
}
int
main (int argc, char **argv)
{
double x = 0.0;
g(&x);
return 0;
}
-- cut here --
Reason I am asking is, g++ 3.3.2 compiles fine, whereas HP's aCC
B3910B A.03.37 and B3910B A.03.31 produce this error message:
Error 328: "msng.c", line 11 # Function 'f' has not been defined yet; cannot call.
f(y);
^
Error 556: "msng.c", line 19 # Unable to generate specialization "void g<double>(double *)" due to errors during generation.
g(&x);
^^^^^
Error 556: "msng.c", line 19 # Unable to generate specialization "void g<double>(double *)" due to errors during generation.
g(&x);
^^^^^
I am a bit reluctant to say this is a compiler bug, because I've been
using templates for only two days, so maybe I'm just being stupid
Any help on this would be very much appreciated!
bye,
I was wondering, is there anything in this short snippet of code that
violates some C++ standard?
-- cut here --
static void
f (double *z)
{
}
template <class T>
static void g (T *y)
{
f(y);
}
int
main (int argc, char **argv)
{
double x = 0.0;
g(&x);
return 0;
}
-- cut here --
Reason I am asking is, g++ 3.3.2 compiles fine, whereas HP's aCC
B3910B A.03.37 and B3910B A.03.31 produce this error message:
Error 328: "msng.c", line 11 # Function 'f' has not been defined yet; cannot call.
f(y);
^
Error 556: "msng.c", line 19 # Unable to generate specialization "void g<double>(double *)" due to errors during generation.
g(&x);
^^^^^
Error 556: "msng.c", line 19 # Unable to generate specialization "void g<double>(double *)" due to errors during generation.
g(&x);
^^^^^
I am a bit reluctant to say this is a compiler bug, because I've been
using templates for only two days, so maybe I'm just being stupid
Any help on this would be very much appreciated!
bye,