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)); } };