Menu

[r16]: / src / nocasecompare.h  Maximize  Restore  History

Download this file

24 lines (20 with data), 426 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#include <string>
using namespace std;
class NoCaseCompare
{
public:
NoCaseCompare();
~NoCaseCompare();
bool operator() (const string& s, const string& t) const
{
return lexicographical_compare(
s.begin(), s.end(),
t.begin(), t.end(),
noCaseCompare);
}
private:
static bool noCaseCompare(char c1, char c2)
{
return toupper(c1) < toupper(c2);
}
};
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.