1
0
Fork 0

Update assoc_heap.hh

This commit is contained in:
Ariel 2024-02-03 00:51:40 +08:00 committed by GitHub
parent 01ec8c04e1
commit 8f645e26ac
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 4 deletions

View File

@ -35,7 +35,7 @@ private:
__assoc_heap(_Tc _content, _T_CC _comp) :
_content(_content), _comp(_comp), _size(0) {}
template <size_t i> constexpr _Tp top() {
template <size_t i> constexpr const _Tp& top() {
__roll<i>();
return get<i>(_content).top();
}
@ -67,8 +67,9 @@ private:
};
public:
template<typename... _T_cs> static auto make(tuple<_T_cs...> _comp) {
auto _container = apply([&](auto... all) { return __map_types(all...); }, _comp);
return __assoc_heap<decltype(_container), tuple<_T_cs...>>(_container, std::move(_comp));
template<typename... _T_cs> static auto make(_T_cs... _comp) {
auto comp = make_tuple(_comp...);
auto _container = apply([&](auto... all) { return __map_types(all...); }, comp);
return __assoc_heap<decltype(_container), tuple<_T_cs...>>(_container, std::move(comp));
}
};