Created
March 17, 2010 04:36
-
-
Save azmfaridee/334922 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef _Ltstr_ | |
#define _Ltstr_ | |
#include <string> | |
#include <cwchar> | |
#include <cstring> | |
using namespace std; | |
struct Ltstr | |
{ | |
bool operator()(string const &s1, string const &s2) const | |
{ | |
return strcmp(s1.c_str(), s2.c_str()) < 0; | |
} | |
bool operator()(wchar_t const *s1, wchar_t const *s2) const | |
{ | |
return wcscmp(s1, s2) < 0; | |
} | |
bool operator()(char const *s1, char const *s2) const | |
{ | |
return strcmp(s1, s2) < 0; | |
} | |
bool operator()(wstring const &s1, wstring const &s2) const | |
{ | |
return wcscmp(s1.c_str(), s2.c_str()) < 0; | |
} | |
}; | |
#endif |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment