diff --git a/api/include/opentelemetry/nostd/function_ref.h b/api/include/opentelemetry/nostd/function_ref.h index edc2007762..1064c966d7 100644 --- a/api/include/opentelemetry/nostd/function_ref.h +++ b/api/include/opentelemetry/nostd/function_ref.h @@ -35,8 +35,8 @@ class function_ref void BindTo(F &f) noexcept { callable_ = static_cast(std::addressof(f)); - invoker_ = [](void *callable_, Args... args) -> R { - return (*static_cast>(callable_))(std::forward(args)...); + invoker_ = [](void *callable, Args... args) -> R { + return (*static_cast>(callable))(std::forward(args)...); }; } @@ -49,8 +49,8 @@ class function_ref return BindTo(nullptr); } callable_ = reinterpret_cast(f); - invoker_ = [](void *callable_, Args... args) -> R { - return (F(callable_))(std::forward(args)...); + invoker_ = [](void *callable, Args... args) -> R { + return (F(callable))(std::forward(args)...); }; }