J
jason.cipriani
In this code:
===
template <int N> class Base { };
template <int N> class Other {
public:
explicit Other (Base<N> &) { }
};
int main () {
Base<3> ok;
Other<3> fine(ok);
}
===
Maybe this is a dumb question, but why do I have to specify the
template parameter to "Other<3> fine(ok)"? Can't it deduce that it
should be a 3 on it's own (since a Base<3> is being passed to the
constructor, and Base<3> has no casting operators that could confuse
it, there's no other type it could be)? I want to just say "Other
fine(ok);".
Jason
===
template <int N> class Base { };
template <int N> class Other {
public:
explicit Other (Base<N> &) { }
};
int main () {
Base<3> ok;
Other<3> fine(ok);
}
===
Maybe this is a dumb question, but why do I have to specify the
template parameter to "Other<3> fine(ok)"? Can't it deduce that it
should be a 3 on it's own (since a Base<3> is being passed to the
constructor, and Base<3> has no casting operators that could confuse
it, there's no other type it could be)? I want to just say "Other
fine(ok);".
Jason