mirror of
https://gitlab.com/fbb-git/cppannotations
synced 2024-11-16 07:48:44 +01:00
6881bc3814
Annotations. The branches and tags directory are empty, since I couldn't svnadmin import a repostitory dump. Many earlier versions exist, though, and if you want the full archive, just let me know and I'll send you the svnadmin dump of my full C++ Annotations archive. Frank B. Brokken <f.b.brokken@rug.nl> git-svn-id: https://cppannotations.svn.sourceforge.net/svnroot/cppannotations/trunk@3 f6dd340e-d3f9-0310-b409-bdd246841980
36 lines
1,017 B
C++
36 lines
1,017 B
C++
#include <algorithm>
|
|
#include <iostream>
|
|
#include <string>
|
|
|
|
class CaseString
|
|
{
|
|
public:
|
|
bool operator()(std::string const &first,
|
|
std::string const &second) const
|
|
{
|
|
return strcasecmp(second.c_str(), first.c_str()) > 0;
|
|
}
|
|
};
|
|
|
|
using namespace std;
|
|
|
|
int main()
|
|
{
|
|
cout << "Word '" << max(string("first"), string("second")) <<
|
|
"' is lexicographically last\n";
|
|
|
|
cout << "Word '" << max(string("first"), string("SECOND")) <<
|
|
"' is lexicographically last\n";
|
|
|
|
cout << "Word '" << max(string("first"), string("SECOND"),
|
|
CaseString()) << "' is lexicographically last\n";
|
|
|
|
return 0;
|
|
}
|
|
/*
|
|
Generated output:
|
|
|
|
Word 'second' is lexicographically last
|
|
Word 'first' is lexicographically last
|
|
Word 'SECOND' is lexicographically last
|
|
*/
|