From 8f645e26ac045075108ff433a379901638090a53 Mon Sep 17 00:00:00 2001 From: Ariel Date: Sat, 3 Feb 2024 00:51:40 +0800 Subject: [PATCH] Update assoc_heap.hh --- trees/assoc_heap.hh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/trees/assoc_heap.hh b/trees/assoc_heap.hh index 13b0a52..74a0507 100644 --- a/trees/assoc_heap.hh +++ b/trees/assoc_heap.hh @@ -35,7 +35,7 @@ private: __assoc_heap(_Tc _content, _T_CC _comp) : _content(_content), _comp(_comp), _size(0) {} - template constexpr _Tp top() { + template constexpr const _Tp& top() { __roll(); return get(_content).top(); } @@ -67,8 +67,9 @@ private: }; public: - template static auto make(tuple<_T_cs...> _comp) { - auto _container = apply([&](auto... all) { return __map_types(all...); }, _comp); - return __assoc_heap>(_container, std::move(_comp)); + template static auto make(_T_cs... _comp) { + auto comp = make_tuple(_comp...); + auto _container = apply([&](auto... all) { return __map_types(all...); }, comp); + return __assoc_heap>(_container, std::move(comp)); } };