Regarding the following C++ code,
LengthAlphabeticalSort lengthAlphabeticalSort;
outputList.sort(lengthAlphabeticalSort); // causes borland 8092 error, guaranteed stable_sort.
class LengthAlphabeticalSort
{
public:
bool operator() (std::string str1, std::string str2)
{
if(str1.length() < str2.length())
return true;
else
return false;
}
};
I get a warning when compiling with the borland compiler:
Warning W8092 worder.cpp 138: template argument _Pr3 passed to 'sort' is not an iterator: random iterator required in function Worder::CommonWords(const Worder &) const Turbo Incremental Link 5.69 Copyright (c) 1997-2005 Borland
Can anybody tell me how to fix this problem? It compiles cleanly with VS2010 and gnu