M
mlimber
Any ideas why this code:
#include <vector>
using namespace std;
struct Foo
{
void Bar( int, int, int );
template<typename T>
void Bar(
typename vector<T>::const_iterator,
typename vector<T>::const_iterator,
int );
};
void Baz()
{
Foo foo;
const vector<int> v( 10u );
foo.Bar( v.begin(), v.end(), 42 );
}
generates this compile-time error:
"ComeauTest.c", line 20: error: no instance of overloaded function
"Foo::Bar" matches the argument list
The argument types that you used are: (
std::vector<int,std::allocator<int>>::const_iterator,
std::vector<int,std::allocator<int>>::const_iterator,
int)
object type is: Foo
foo.Bar( v.begin(), v.end(), 42 );
^
I expected the compiler to select the templatized overload.
Cheers! --M
#include <vector>
using namespace std;
struct Foo
{
void Bar( int, int, int );
template<typename T>
void Bar(
typename vector<T>::const_iterator,
typename vector<T>::const_iterator,
int );
};
void Baz()
{
Foo foo;
const vector<int> v( 10u );
foo.Bar( v.begin(), v.end(), 42 );
}
generates this compile-time error:
"ComeauTest.c", line 20: error: no instance of overloaded function
"Foo::Bar" matches the argument list
The argument types that you used are: (
std::vector<int,std::allocator<int>>::const_iterator,
std::vector<int,std::allocator<int>>::const_iterator,
int)
object type is: Foo
foo.Bar( v.begin(), v.end(), 42 );
^
I expected the compiler to select the templatized overload.
Cheers! --M