From b0e7cf705a8b47799120fa33b3d085b3e11f2eba Mon Sep 17 00:00:00 2001 From: David Stone Date: Tue, 19 Dec 2023 14:19:33 -0700 Subject: [PATCH] Support argument types for `stored_function` --- source/containers/algorithms/generate.cpp | 2 +- source/containers/stored_function.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/source/containers/algorithms/generate.cpp b/source/containers/algorithms/generate.cpp index f37d0c36..5c3b72ca 100644 --- a/source/containers/algorithms/generate.cpp +++ b/source/containers/algorithms/generate.cpp @@ -167,7 +167,7 @@ struct indexed_generate_n_iterator { } private: [[no_unique_address]] Offset m_offset; - [[no_unique_address]] stored_function m_generator; + [[no_unique_address]] stored_function> m_generator; }; export template Function> diff --git a/source/containers/stored_function.cpp b/source/containers/stored_function.cpp index 3b39dcfc..b1762874 100644 --- a/source/containers/stored_function.cpp +++ b/source/containers/stored_function.cpp @@ -12,9 +12,9 @@ import std_module; namespace containers { -export template +export template using stored_function = std::conditional_t< - std::invocable, + std::invocable, reference_or_value, std::reference_wrapper >;