From 8b41b0e079f6395a194af5fb7fc96d60370e85b0 Mon Sep 17 00:00:00 2001 From: YexuanXiao Date: Sat, 14 Mar 2026 01:35:03 +0800 Subject: [PATCH] Simplify get_activation_factory --- cppwinrt/component_writers.h | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/cppwinrt/component_writers.h b/cppwinrt/component_writers.h index c70567948..7b29853a6 100644 --- a/cppwinrt/component_writers.h +++ b/cppwinrt/component_writers.h @@ -106,7 +106,7 @@ namespace cppwinrt if (settings.component_opt) { auto format = R"( - if (requal(name, L"%.%")) + if (name == L"%.%"sv) { return winrt_make_%(); } @@ -120,7 +120,7 @@ namespace cppwinrt else { auto format = R"( - if (requal(name, L"%.%")) + if (name == L"%.%"sv) { return winrt::detach_abi(winrt::make()); } @@ -151,11 +151,7 @@ bool __stdcall %_can_unload_now() noexcept void* __stdcall %_get_activation_factory([[maybe_unused]] std::wstring_view const& name) { - auto requal = [](std::wstring_view const& left, std::wstring_view const& right) noexcept - { - return std::equal(left.rbegin(), left.rend(), right.rbegin(), right.rend()); - }; -% + using namespace std::string_view_literals;% return nullptr; } )";