Proxy 4.0.0 β Skills, semantics, and better codegen π #340
mingxwa
announced in
Announcements
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Proxy 4 focuses on a composable skills API, refined core semantics for the basic building blocks, and leaner code generation. It remains header-only and keeps 3.x coexistence paths introduced in 3.4.0.
New: a refreshed documentation site at https://microsoft.github.io/proxy/ and out-of-the-box availability on Compiler Explorer. Proxy now also supports the Intel oneAPI C++ compilers in CI.
What's inside
Skills and builder
basic_facade_buildergainsadd_skilland moves feature toggles intopro::skills(format,wformat,rtti,as_view,as_weak,slim). [Refactorbasic_facade_builderΒ #285]proxy_fmt.hwithpro::skills::fmt_formatandfmt_wformat(requires {fmt} >= 6.1; include<proxy/proxy.h>and {fmt} beforeproxy_fmt.h). [Add skills for {fmt}Β #287]Core semantics and ergonomics
proxy::facade_typealias and stricter polymorphic ctor/assignment constraints (pointer-like only). [Improve semantics ofproxyΒ #278]proxy_invokenow passes the proxy reference to indirect function pointers, enabling leaner call sequences around indirect calls; removed deprecatedPRO_DEF_WEAK_DISPATCH(since 3.2.0).access_proxyandproxiable_ptr_constraints; refined ProAccessible, ProBasicFacade, ProFacade, ProDispatch, and ProOverload requirements; accessing a nullproxyis erroneous behavior; updated spec and tests. [Improve design qualityΒ #320, Revise the semantics of *ProAccessible*Β #336]proxy_indirect_accessoris no longer copyable/movable to prevent misuse; added tests. [Improveproxy_indirect_accessorΒ #335]is_bitwise_trivially_relocatableand updated dispatch/pointer internals to support bitwise trivially relocatable but non-movable types. We did not adopt the C++26 "trivially relocatable" model; Proxy follows the "bitwise trivially relocatable" direction to preserve memcpy-based relocation semantics (see P3780R0). [Support bitwise trivial relocatabilityΒ #330]++/--to returnproxy&(like assignment operators). [Fix return type for prefix operator++ and operator--Β #332]weak_proxysupports upward conversion. [weak_proxysupport upward conversionΒ #286]C++20 modules
.ixx) and separated convenience macros to support modules. A huge thanks to @SidneyCogdill for leading this effort. See the modules support docs for usage caveats and current CMake module export limitations. [Separate macro definitions and add cppm filesΒ #293]Code generation
proxy_invokeadjustments reduce surrounding instructions. [Improveproxy_invokeΒ #280]<format>is unavailable are supported; features that need formatting are conditional. [Support build environments where<format>is not availableΒ #289]Toolchain and CI
Docs and site
Upgrading
Most users can update includes and CMake targets and rebuild. If you customized dispatches/skills or relied on old behaviors, see notes below.
Headers and namespaces
<proxy/proxy.h>. Versioned headers remain under<proxy/v4/>. Code lives inpro::v4inline namespace.CMake package/targets
msft_proxy4. Example:find_package(msft_proxy4 REQUIRED)target_link_libraries(your_target PRIVATE msft_proxy4::proxy).ixxsources are shipped but export workflows vary by toolchain.Builder and skills
basic_facade_builder::support(...)->add_skill<...>(). Feature toggles are inpro::skills(e.g.,pro::skills::rtti,::as_view,::as_weak,::fmt_format).proxy_fmt.hfor {fmt} skills; include<proxy/proxy.h>and {fmt} first.Removed and changed behaviors
PRO_DEF_WEAK_DISPATCHremoved (deprecated since 3.2.0). Use standard dispatch patterns; weak fallbacks can call back intoproxy.proxyis erroneous behavior. Audit code paths that may dereference disengaged proxies.proxy_indirect_accessorisn't copyable/movable; avoid storing*p; consume it immediately.is_bitwise_trivially_relocatableguidance.Formatting availability
<format>is not available on your toolchain, Proxy will still build; only format-dependent skills/features are disabled. Use {fmt} skills if desired.Refer to the updated docs and FAQ for side-by-side 3.x/4.x migration in large codebases, module usage notes, and relocatability guidance.
Acknowledgments
What's Changed (selected PRs)
weak_facadeby @mingxwa in Fix typo in the spec ofweak_facadeΒ #275offsetofto eliminate undefined behavior by @mingxwa in Removeoffsetofto eliminate undefined behaviorΒ #276proxyby @mingxwa in Improve semantics ofproxyΒ #278proxy_invokeby @mingxwa in Improveproxy_invokeΒ #280basic_facade_builderby @mingxwa in Refactorbasic_facade_builderΒ #285weak_proxysupport upward conversion by @mingxwa inweak_proxysupport upward conversionΒ #286<format>is not available by @mingxwa in Support build environments where<format>is not availableΒ #289proxy_indirect_accessorby @mingxwa in Improveproxy_indirect_accessorΒ #335New Contributors
Full changelog: 3.4.0...4.0.0
This discussion was created from the release Proxy 4.0.0 β Skills, semantics, and better codegen π.
Beta Was this translation helpful? Give feedback.
All reactions