A
Alexander Stippler
Hello,
short question: What is illegal about the following code?
template <typename T>
class Method
{
};
class Procedure
{
public:
template <typename T>
Procedure(const Method<T> &rhs);
double
operator()(double x);
};
int
main()
{
Procedure p(Method<double>());
p(1.);
return 0;
}
I want the operator() to be called with p(1.), but the compiler thinks
different and wants to choose the constructor? Why?
regards,
alex
short question: What is illegal about the following code?
template <typename T>
class Method
{
};
class Procedure
{
public:
template <typename T>
Procedure(const Method<T> &rhs);
double
operator()(double x);
};
int
main()
{
Procedure p(Method<double>());
p(1.);
return 0;
}
I want the operator() to be called with p(1.), but the compiler thinks
different and wants to choose the constructor? Why?
regards,
alex