From 781877bd26ed7ab01ae6cf952bf4691641593ed2 Mon Sep 17 00:00:00 2001 From: Steven Le Rouzic Date: Sat, 22 Mar 2025 01:21:56 +0100 Subject: Add function_ref --- asl/types/function.hpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'asl/types/function.hpp') diff --git a/asl/types/function.hpp b/asl/types/function.hpp index 6460711..40387ba 100644 --- a/asl/types/function.hpp +++ b/asl/types/function.hpp @@ -196,7 +196,7 @@ public: { if (m_op != nullptr) { - (*m_op)( + m_op( &m_storage, const_cast(&other.m_storage), // NOLINT(*-const-cast) function_detail::FunctionOp::kCopyFromOtherToThisUninit); @@ -209,7 +209,7 @@ public: { if (m_op != nullptr) { - (*m_op)( + m_op( &m_storage, &other.m_storage, function_detail::FunctionOp::kMoveFromOtherToThisUninit); @@ -230,7 +230,7 @@ public: m_invoke = other.m_invoke; m_op = other.m_op; - (*m_op)( + m_op( &m_storage, const_cast(&other.m_storage), // NOLINT(*-const-cast) function_detail::FunctionOp::kCopyFromOtherToThisUninit); @@ -247,7 +247,7 @@ public: m_invoke = asl::exchange(other.m_invoke, nullptr); m_op = asl::exchange(other.m_op, nullptr); - (*m_op)( + m_op( &m_storage, &other.m_storage, function_detail::FunctionOp::kMoveFromOtherToThisUninit); @@ -277,7 +277,7 @@ public: constexpr R operator()(Args... args) const { ASL_ASSERT(m_invoke); - return (*m_invoke)(args..., m_storage); + return m_invoke(args..., m_storage); } }; -- cgit