Is it possible to create a function that takes a list of elements of any imaginable type and returns an operator that can act as a comparator for ordering the elements? In other words, 

```
template typename<T> ??? getComparator ( T a )
{
     // ...
}

```

where I put `???` because I'm not sure what the return type would be. The idea, however, is that if I called 

```
getComparator(int i)

```

it would probably return 

```
bool smallerThan(int a, int b) { return (a < b); }

```

and if I created a custom object

```
struct thingamabob { int i; std::string s; int ***** ptr; }
thingamabob myThing; 

```

I could feed `myThing` into `getComparator` and it would figure out how to create a function of return type `bool` that takes two objects of type `myThing` and is that such for any 3 objects 

```
thingamabob thing1, thing2, thing3; 

```

with

```
thing1 != thing2 && thing2 != thing3 && thing1 != thing3

```

then I can get some `<` such that either

```
thing1 <= thing2 && thing2 <= thing3

```

or

```
thing1 <= thing3 && thing3 <= thing2

```

or

```
thing3 <= thing1 && thing1 <= thing2

```

or 

```
thing2 <= thing1 && thing1 <= thing3

```

or 

```
thing2 <= thing3 && thing3 <= thing1

```

or 

```
thing3 <= thing1 && thing1 <= thing2

```

or 

```
thing3 <= thing2 && thing2 <= thing3

```