This code will not work due to the - 1 on l2 (which can be unsigned).
Possibly just + 1 on h1 rather?
static inline bool overlaps(numerical_type l1, numerical_type h1, numerical_type l2, numerical_type h2)
{
return (l1 <= (h2 + 1)) && ((l2 - 1) <= h1);
}