> you can use overloading to define > several functions of the same name, and just write out one for each > range type you actually need this functionality for. Thanks! I was hoping to avoid that, but it's what I wound up doing after all, as you can see here: https://github.com/pjungwir/range_agg In the README I give instructions to create a new aggregate with a custom range type, and it is actually not bad at all, since the same C function can serve as implementation in all cases. Thanks again, Paul