From 421d4b432d2b348057ac6d271af8550b27538f12 Mon Sep 17 00:00:00 2001 From: morzhovets Date: Fri, 1 Nov 2024 22:50:27 +0400 Subject: [PATCH] TreeTraits --- include/momo/TreeTraits.h | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/include/momo/TreeTraits.h b/include/momo/TreeTraits.h index 267acfda..6e72970d 100644 --- a/include/momo/TreeTraits.h +++ b/include/momo/TreeTraits.h @@ -120,7 +120,7 @@ template, bool tMultiKey = false, typename TTreeNode = TreeNodeDefault> -class TreeTraitsStd : private TLessFunc +class TreeTraitsStd { public: typedef TKey Key; @@ -140,7 +140,7 @@ class TreeTraitsStd : private TLessFunc public: explicit TreeTraitsStd(const LessFunc& lessFunc = LessFunc()) - : LessFunc(lessFunc) + : mLessFunc(lessFunc) { } @@ -152,13 +152,16 @@ class TreeTraitsStd : private TLessFunc template bool IsLess(const KeyArg1& key1, const KeyArg2& key2) const { - return LessFunc::operator()(key1, key2); + return mLessFunc(key1, key2); } const LessFunc& GetLessFunc() const noexcept { - return *this; + return mLessFunc; } + +private: + /*[[no_unique_address]]*/ LessFunc mLessFunc; }; } // namespace momo