From 18a6c3d953ee47fb9b7657474882d4a5b35ac4cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klepl?= Date: Sat, 11 Nov 2023 19:47:33 +0100 Subject: [PATCH] planner is trivially copyable, but msvc prefers passing by reference --- include/noarr/structures/extra/planner.hpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/include/noarr/structures/extra/planner.hpp b/include/noarr/structures/extra/planner.hpp index 5816cce..deb6114 100644 --- a/include/noarr/structures/extra/planner.hpp +++ b/include/noarr/structures/extra/planner.hpp @@ -40,20 +40,20 @@ struct planner_ending_elem_t : flexible_contain { } template - constexpr void operator()(Planner planner) const noexcept { + constexpr void operator()(const Planner &planner) const noexcept { run(planner, std::make_index_sequence()); } private: template - constexpr void run(Planner planner, std::index_sequence) const noexcept + constexpr void run(const Planner &planner, std::index_sequence) const noexcept requires (requires(F f) { f(planner.template get_struct()[planner.state()]...); }) { flexible_contain::get()(planner.template get_struct()[planner.state()]...); } template - constexpr void run(Planner planner, std::index_sequence) const noexcept + constexpr void run(const Planner &planner, std::index_sequence) const noexcept requires (requires(F f) { f(planner.state(), planner.template get_struct()[planner.state()]...); }) { flexible_contain::get()(planner.state(), planner.template get_struct()[planner.state()]...); @@ -82,7 +82,7 @@ struct planner_ending_t : flexible_contain { } template - constexpr void operator()(Planner planner) const noexcept { + constexpr void operator()(const Planner &planner) const noexcept { flexible_contain::get()(planner.state()); } }; @@ -164,7 +164,7 @@ struct planner_endings : flexible_contain { } template - constexpr void operator()(Planner planner) const noexcept requires is_activated_vorder(fix(state_at(planner.top_struct(), empty_state))))> { + constexpr void operator()(const Planner &planner) const noexcept requires is_activated_vorder(fix(state_at(planner.top_struct(), empty_state))))> { this->template get().order(fix(state_at(planner.top_struct(), empty_state))))::activated_index()>()(planner.pop_endings()); } }; @@ -210,7 +210,7 @@ struct planner_sections_t : flexible_contain { } template - constexpr void operator()(Planner planner) const noexcept { + constexpr void operator()(const Planner &planner) const noexcept { flexible_contain::get()(planner); } };