diff --git a/ostd/keyset.hh b/ostd/keyset.hh index 6108f1d..0905efb 100644 --- a/ostd/keyset.hh +++ b/ostd/keyset.hh @@ -19,11 +19,17 @@ namespace ostd { namespace detail { template - using KeysetKey = const Decay().get_key())>; + using KeysetKeyRet = decltype(declval().get_key()); + template + using KeysetKey = const Decay>; template struct KeysetBase { using Key = KeysetKey; - static inline const Key &get_key(const T &e) { + + using RetKey = Conditional< + IsReference>::value, Key &, Key + >; + static inline RetKey get_key(const T &e) { return e.get_key(); } static inline T &get_data(T &e) {