boostorg / hana

Your standard library for metaprogramming
http://boostorg.github.io/hana
Boost Software License 1.0
1.66k stars 217 forks source link

Consider allowing custom key comparators in associative data structures #25

Open ldionne opened 9 years ago

ldionne commented 9 years ago

Right now, a Set uses equal on its elements to determine their uniqueness. It might be useful to provide a custom key comparator for more complex behaviours. In the same vein, Map currently uses equal on its keys to determine the uniqueness of elements; it might be useful to allow for a custom comparator.

However, compile-time sets are super hairy to implement, and honestly I am unsure how this could be achieved without ruining the compile-time performance of the associative data structures (which is already super poor because the implementation is naive). Also note that I do not think a compile-time efficient associative data structure can be implemented unless we put stringent requirements on how the elements are compared. Specifically, the only compile-time efficient associative data structure I can think of is where all the keys are types, or all the keys are indices (in which case it's a tuple).

VaibhavMalik4187 commented 2 years ago

@ldionne I am interested in working on this issue, but I am a bit unclear about what am I supposed to do, if you can just help me understand a little about the issue, may be I can help