From ec64a988ae29b945610570715fc0fbaa60a42348 Mon Sep 17 00:00:00 2001 From: Kenny Kerr Date: Thu, 10 Mar 2022 12:47:19 -0800 Subject: [PATCH] remove workaround --- cppwinrt/code_writers.h | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/cppwinrt/code_writers.h b/cppwinrt/code_writers.h index 9d4b98e23..3c09f2202 100644 --- a/cppwinrt/code_writers.h +++ b/cppwinrt/code_writers.h @@ -1199,17 +1199,9 @@ namespace cppwinrt method_signature signature{ method }; auto async_types_guard = w.push_async_types(signature.is_async()); - // - // Note: this use of a lambda is a workaround for a Visual C++ compiler bug: - // https://developercommunity.visualstudio.com/content/problem/554130/incorrect-code-gen-when-invoking-a-conversion-oper.html - // Once fixed, revert the function body back to this: - // - // return static_cast<% const&>(*this).%(%); - // - std::string_view format = R"( inline WINRT_IMPL_AUTO(%) %::%(%) const% { - return [&](% const& winrt_impl_base) { return winrt_impl_base.%(%); }(*this); + return static_cast<% const&>(*this).%(%); } )";