Skip to content

Work around an MSVC 19.52 bug in the generated invocation functions - #116

Merged
mingxwa merged 1 commit into
ngcpp:feature/v5from
mingxwa:user/mingxwa/msvc1452
Nov 21, 2026
Merged

mingxwa merged 1 commit into
ngcpp:feature/v5from
mingxwa:user/mingxwa/msvc1452

Conversation

@mingxwa

@mingxwa mingxwa commented Nov 21, 2026

Copy link
Copy Markdown
Member
  • Moved the generated function of each signature from a lambda variable template inside signature_traits_impl to a namespace-scope variable template, because MSVC 19.52 fails to convert the lambda to a function pointer from the second specialization of a member variable template on when its parameters expand the enclosing class template's pack (C2440). The member variable template now copies the closure, so each specialization keeps its own closure type and the call sites are unchanged.
  • Replaced signature_traits_impl::pointer_type with erased_ptr_t so the namespace-scope variable template can name the erased pointer type.

https://developercommunity.visualstudio.com/t/Member-variable-template-initialized-by-/11182704

- Moved the generated function of each signature from a lambda variable template inside signature_traits_impl to a namespace-scope variable template, because MSVC 19.52 fails to convert the lambda to a function pointer from the second specialization of a member variable template on when its parameters expand the enclosing class template's pack (C2440). The member variable template now copies the closure, so each specialization keeps its own closure type and the call sites are unchanged.
- Replaced signature_traits_impl::pointer_type with erased_ptr_t so the namespace-scope variable template can name the erased pointer type.
@mingxwa
mingxwa merged commit f25b65e into ngcpp:feature/v5 Nov 21, 2026
19 checks passed
@mingxwa
mingxwa deleted the user/mingxwa/msvc1452 branch November 21, 2026 05:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant