<p>I want to hold a bunch of const char pointers into an std::set container [1].  std::set template requires a comparator functor, and the standard C++ library offers std::less, but its implementation is based on comparing the two keys directly, which is not standard for pointers.</p>

<p>I know I can define my own functor and implement the operator() by casting the pointers to integers and comparing them, but is there a cleaner, 'standard' way of doing it?</p>

<p>Please do not suggest creating std::strings - it is a waste of time and space.  The strings are static, so they can be compared for (in)equality based on their address.</p>

<p>1: The pointers are to static strings, so there is no problem with their lifetimes - they won't go away.</p>

Depending on how big a "bunch" is, I would be inclined to store a corresponding bunch of
```
std::string
```
s in the set. That way you won't have to write any extra glue code.