T
tobias.loew
Hi,
I wanted my compiler (MSVC 9, VS2008) to deduce the template type of a function template from a default argument, but it doesn't work.
template< class _dummy >
void test( _dummy d = false )
{
....
}
void foo()
{
test(); // <-- error C2783: "void test(_dummy)": could not deduce template argument for "_dummy"
}
So I looked into the standard (N3337) but I couldn't find anything specific for this case (neither at 14.8.2.1 nor at 8.3.5).
Is there any reason, why this is not possible, or is it just an error in my compiler?
regards
Tobias
I wanted my compiler (MSVC 9, VS2008) to deduce the template type of a function template from a default argument, but it doesn't work.
template< class _dummy >
void test( _dummy d = false )
{
....
}
void foo()
{
test(); // <-- error C2783: "void test(_dummy)": could not deduce template argument for "_dummy"
}
So I looked into the standard (N3337) but I couldn't find anything specific for this case (neither at 14.8.2.1 nor at 8.3.5).
Is there any reason, why this is not possible, or is it just an error in my compiler?
regards
Tobias