From 057bfbecba69d112318dea522d395c87967a9432 Mon Sep 17 00:00:00 2001 From: Loic Gouarin Date: Thu, 6 Feb 2025 10:03:20 +0100 Subject: [PATCH] fix: add make_field_function (#266) ## Description The `make_field_function` was removed in a previous version, but it is used in external projects. This PR simply adds it back. ## Code of Conduct By submitting this PR, you agree to follow our [Code of Conduct](https://github.com/hpc-maths/samurai/blob/master/docs/CODE_OF_CONDUCT.md) - [x] I agree to follow this project's Code of Conduct --- include/samurai/field_expression.hpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/include/samurai/field_expression.hpp b/include/samurai/field_expression.hpp index c25c4b2ae..42db200ed 100644 --- a/include/samurai/field_expression.hpp +++ b/include/samurai/field_expression.hpp @@ -122,6 +122,13 @@ namespace samurai , m_f(std::forward(f)) { } + + template + inline auto make_field_function(E&&... e) noexcept + { + using type = field_function; + return type(F(), std::forward(e)...); + } } // namespace samurai namespace xt::detail