Including <string> causes the following error(s):
f:/djgpp/lang/cxx/std/sinst.h:62: ambiguous template instantiation for `operator
>(const basic_string<char,string_char_traits<char> > &, const char *)' requeste
d
This is repeated for operator!=, >, >=, <, and <=.
The reason for this is that definations for these operators in
lang/cxx/std/bastring.h collide with templates in <function>
Remove the decl's for operator<=, !=, > and >= in lang/cxx/std/bastring.h. My
modifications to bastring.h are is included below:
<Start of file snippet>
// Main templates for the -*- C++ -*- string classes.
...
#if 0
template <class charT, class traits>
inline bool
operator!= (const charT* lhs, const basic_string <charT, traits>& rhs)
{
return (rhs.compare (lhs) != 0);
}
template <class charT, class traits>
inline bool
operator!= (const basic_string <charT, traits>& lhs, const charT* rhs)
{
return (lhs.compare (rhs) != 0);
}
#endif
...
#if 0
template <class charT, class traits>
inline bool
operator> (const charT* lhs, const basic_string <charT, traits>& rhs)
{
return (rhs.compare (lhs) < 0);
}
template <class charT, class traits>
inline bool
operator> (const basic_string <charT, traits>& lhs, const charT* rhs)
{
return (lhs.compare (rhs) > 0);
}
template <class charT, class traits>
inline bool
operator<= (const charT* lhs, const basic_string <charT, traits>& rhs)
{
return (rhs.compare (lhs) >= 0);
}
template <class charT, class traits>
inline bool
operator<= (const basic_string <charT, traits>& lhs, const charT* rhs)
{
return (lhs.compare (rhs) <= 0);
}
template <class charT, class traits>
inline bool
operator>= (const charT* lhs, const basic_string <charT, traits>& rhs)
{
return (rhs.compare (lhs) <= 0);
}
template <class charT, class traits>
inline bool
operator>= (const basic_string <charT, traits>& lhs, const charT* rhs)
{
return (lhs.compare (rhs) >= 0);
}
#endif
// Kludge this until g++ supports the new template overloading semantics.
#if 0 // #if !defined(FUNCTION_H)
template <class charT, class traits>
inline bool
operator!= (const basic_string <charT, traits>& lhs,
const basic_string <charT, traits>& rhs)
{
return (lhs.compare (rhs) != 0);
}
template <class charT, class traits>
inline bool
operator> (const basic_string <charT, traits>& lhs,
const basic_string <charT, traits>& rhs)
{
return (lhs.compare (rhs) > 0);
}
template <class charT, class traits>
inline bool
operator<= (const basic_string <charT, traits>& lhs,
const basic_string <charT, traits>& rhs)
{
return (lhs.compare (rhs) <= 0);
}
template <class charT, class traits>
inline bool
operator>= (const basic_string <charT, traits>& lhs,
const basic_string <charT, traits>& rhs)
{
return (lhs.compare (rhs) >= 0);
}
#endif
...
#endif
<EOF>