hi my friend
ok as you know in header file string declare
1 2 3 4 5 6 7 8 9
template<class _Elem,
class _Traits,
class _Alloc> inlinebool __CLRCALL_OR_CDECL operator<(
const basic_string<_Elem, _Traits, _Alloc>& _Left,
const basic_string<_Elem, _Traits, _Alloc>& _Right)
{ // test if string < string
return (_Left.compare(_Right) < 0);
}
and if everywhere you compare two string then use of this code.ok how can i write operator < to compare two string so that everywhere use of this not operator < in string header file !!! note : my compiler is vs 2008 pro NOT TEAM SYSTEM.
for exm if i want compare ignore_case two string in sort stl algorithm without send pred to this function and use automatic my operator < .
tnx and so sorry if my eng language is too bad :D :D
You'll need to put it in the std namespace, then as long as the compiler sees your function, it will be a better match than the template version and be selected by the compiler.