In:
template<typename T, typename U>
void foo(U u) {}
template<typename T, typename U>
struct bar {
bar(U u) {}
};
int main() {
foo<int>(true);
bar<int>(true);
}
you get:
foo.cc: In function `int main()':
foo.cc:11: error: wrong number of template arguments (1, should be 2)
foo.cc:5: error: provided for `template<class T, class U> struct bar'
Shouldn't both the call and the constructor require two args, or both require
only one? I thought constructors resolved like functions.
Ivan
--
Summary: Inconsistent function/constructor template requirements
Product: gcc
Version: 3.4.0
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: igodard at pacbell dot net
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21661