Skip to content

Instantly share code, notes, and snippets.

@azmfaridee
Created March 17, 2010 04:36
Show Gist options
  • Save azmfaridee/334922 to your computer and use it in GitHub Desktop.
Save azmfaridee/334922 to your computer and use it in GitHub Desktop.
#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