I tried to make this simple stuff, and Visual Studio 2008 did not seem to like it.
template <class CharType> class SomeClass { public: template <class T1, class T2> static bool SomeOperator(const typename T1::const_iterator& p_Begin1, const typename T1::const_iterator& p_End1, const typename T2::const_iterator& p_Begin2, const typename T2::const_iterator& p_End2) {
And call it something like this:
std::wstring a; OtherString b; SomeClass<wchar_t>::SomeOperator(a.begin(), a.end(), b.begin(), b.end());
I get compiler errors stating that it cannot output the template parameter T1 and T2
error C2783: 'bool SomeClass<CharType>::SomeOperator(const T1::const_iterator &,const T1::const_iterator &,const T2::const_iterator &,const T2::const_iterator &)' : could not deduce template argument for 'T1' error C2783: 'bool SomeClass<CharType>::SomeOperator(const T1::const_iterator &,const T1::const_iterator &,const T2::const_iterator &,const T2::const_iterator &)' : could not deduce template argument for 'T2'
source share