diff --git a/nui/include/nui/frontend/attributes/reference.hpp b/nui/include/nui/frontend/attributes/reference.hpp index e3be62a..70ee88e 100644 --- a/nui/include/nui/frontend/attributes/reference.hpp +++ b/nui/include/nui/frontend/attributes/reference.hpp @@ -19,7 +19,7 @@ namespace Nui::Attributes requires std::invocable Attribute onMaterialize(T&& func) const { - return operator=([&func](std::weak_ptr&& element) { + return operator=([func = std::forward(func)](std::weak_ptr&& element) { func(element.lock()->val()); }); }