Hi.
When I try to compile this piece of Code with VC.NET 2003
// code start
#include <vector>
template< class T > struct Marker
{
public:
Marker() : err( 0 ) {}
unsigned long err;
};
template< class T > struct MarkerTable
{
public:
typedef std::vector< Marker<T> > TableType;
TableType data;
typename TableType::iterator FindErr( unsigned long ); // line 15
};
template< class T >
typename MarkerTable<T>::TableType::iterator
MarkerTable<T>::FindErr( unsigned long n )
{
typename TableType::iterator iter
= lower_bound( data.begin(), data.end(), Marker<T>( 0, n ) );
if( ( data.end() != iter ) && ( (*iter).err != n ) ) {
iter = data.end();
}
return iter;
} // line 28
// code end
I get the error
line 28 : error C2244: 'MarkerTable<T>::FindErr' : unable to match function
definition to an existing declaration
line 15 : see declaration of 'MarkerTable<T>::FindErr'
definition
'std::vector<T,T2>::iterator MarkerTable<T>::FindErr(unsigned long)'
existing declarations
'vector<Marker<T>>::iterator MarkerTable<T>::FindErr(unsigned long)'
Comeau compiles with no error.
Can you tell me what I'm doing wrong ?
Maett