Skip to content

Commit

Permalink
Support argument types for stored_function
Browse files Browse the repository at this point in the history
  • Loading branch information
davidstone committed Dec 19, 2023
1 parent 37de58b commit b0e7cf7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion source/containers/algorithms/generate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ struct indexed_generate_n_iterator {
}
private:
[[no_unique_address]] Offset m_offset;
[[no_unique_address]] stored_function<Function const> m_generator;
[[no_unique_address]] stored_function<Function const, generate_index_type<Offset>> m_generator;
};

export template<typename Size, index_invocable<Size> Function>
Expand Down
4 changes: 2 additions & 2 deletions source/containers/stored_function.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ import std_module;

namespace containers {

export template<typename Function>
export template<typename Function, typename... Args>
using stored_function = std::conditional_t<
std::invocable<Function const &>,
std::invocable<Function const &, Args...>,
reference_or_value<Function>,
std::reference_wrapper<Function>
>;
Expand Down

0 comments on commit b0e7cf7

Please sign in to comment.