Sensei
[...]
My attempt is now to use a 128bit integers, and extract MSB/LSB as before. The difference is using a const member function. Of course, I've specialized std::less for my type.
This is off-topic, but you don't need to specialize std::less for __uint128_t because the default implementation does exactly the same as your specialization (both use operator<).
[...]
From the documentation I see that I need in const_mem_fun<> in order, the input type, the output type, and the address of a member function, a const member in my case.
const_mem_fun expects a member function *of the class being inserted
into the container* (which in your case is __uint128_t), not just
any member function of some unrelated class (in your case, you're
trying to plug &Data::msb and &Data::lsb).
So, turn &Data::msb and &Data::lsb into *static* member functions
(as they're really global functions, not needing to access any
member of Data):
static uint64_t msb(__uint128_t storage)
{
return static_cast