Releases: microsoft/proxy
Proxy 4.0.1 Release
4.0.1 is a focused patch: it introduces a small but foundational substitution_dispatch API (formalizing what "upward conversion" tried to express), tightens proxy_view & skills::as_view semantics to prevent accidental lifetime bugs, and fixes facade‑aware view behavior. It also refreshes the spec/docs and updates CI.
What's Changed
- Fix
proxy_viewwith facade-aware overloads by @mingxwa in #347 - Forbid conversion from rvalue of
proxytoproxy_viewby @mingxwa in #352 - Fix NVHPC pipeline by @mingxwa in #354
- Introduce new API: substitution_dispatch by @mingxwa in #353
- Revise documentation by @mingxwa in #355
Full Changelog: 4.0.0...4.0.1
Proxy 4.0.0 — Skills, semantics, and better codegen 🚀
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). [#285]- {fmt} integration via
proxy_fmt.hwithpro::skills::fmt_formatandfmt_wformat(requires {fmt} >= 6.1; include<proxy/proxy.h>and {fmt} beforeproxy_fmt.h). [#287]
-
Core semantics and ergonomics
proxy::facade_typealias and stricter polymorphic ctor/assignment constraints (pointer-like only). [#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).- Improved design contracts: removed
access_proxyandproxiable_ptr_constraints; refined ProAccessible, ProBasicFacade, ProFacade, ProDispatch, and ProOverload requirements; accessing a nullproxyis erroneous behavior; updated spec and tests. [#320, #336] proxy_indirect_accessoris no longer copyable/movable to prevent misuse; added tests. [#335]- Introduced
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). [#330] - Fixed prefix
++/--to returnproxy&(like assignment operators). [#332] weak_proxysupports upward conversion. [#286]
-
C++20 modules
- Introduced C++20 module interface files (
.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. [#293]
- Introduced C++20 module interface files (
-
Code generation
- Leaner indirect call paths via
proxy_invokeadjustments reduce surrounding instructions. [#280] - Builds where
<format>is unavailable are supported; features that need formatting are conditional. [#289]
- Leaner indirect call paths via
-
Toolchain and CI
-
Docs and site
- New docs site (MkDocs) with dark theme and improved navigation. See the FAQ for major upgrade guidance. Extracted example code from docs; updated sample links. [#299, #331, #311, #291, #328]
- clang-format applied and enforced in CI; code and macro cleanup for standard naming. [#309, #314, #283, #316, #317]
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
- Preferred include:
<proxy/proxy.h>. Versioned headers remain under<proxy/v4/>. Code lives inpro::v4inline namespace.
- Preferred include:
-
CMake package/targets
- New package/namespace:
msft_proxy4. Example:find_package(msft_proxy4 REQUIRED)target_link_libraries(your_target PRIVATE msft_proxy4::proxy)- For the module interface, see docs;
.ixxsources are shipped but export workflows vary by toolchain.
- New package/namespace:
-
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).- New header
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.- Accessing a null
proxyis erroneous behavior. Audit code paths that may dereference disengaged proxies. proxy_indirect_accessorisn't copyable/movable; avoid storing*p; consume it immediately.- Relocatability: prefer pointer-like indirections if a type fails proxiable checks; see relocatability docs and
is_bitwise_trivially_relocatableguidance.
-
Formatting availability
- If
<format>is not available on your toolchain, Proxy will still build; only format-dependent skills/features are disabled. Use {fmt} skills if desired.
- If
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)
- Fix typo in the spec of
weak_facadeby @mingxwa in #275 - Remove
offsetofto eliminate undefined behavior by @mingxwa in #276 - Improve semantics of
proxyby @mingxwa in #278 - Improve
proxy_invokeby @mingxwa in #280 - Upgrade Clang version in the CI pipeline by @mingxwa in #282
- Code clean up by @mingxwa in #283
- Refactor
basic_facade_builderby @mingxwa in #285 weak_proxysupport upward conversion by @mingxwa in #286- Support build environments where
<format>is not available by @mingxwa in #289 - Add skills for {fmt} by @mingxwa in #287
- Extract example code from docs by @mingxwa in #291
- Separate macro definitions and add cppm files by @SidneyCogdill in #293
- Project rename: Proxy -> Proxy 4 by @SidneyCogdill in #302
- Make package name matches namespace name by @SidneyCogdill in #307
- Apply clang-format by @mingxwa in #309
- Revise documentation by @mingxwa in #299
- Add FAQ for major version upgrade by @mingxwa in #311
- Fix release pipeline by @mingxwa in #313
- Apply clang-format to the whole repository by @mingxwa in #314
- Code cleanup by @mingxwa in #316
- Clean up macros by @mingxwa in #317
- Improve design quality by @mingxwa in #320
- Support trivial relocatability by @mingxwa in #321
- Revise skills by @mingxwa in #324
- Fix MSVC build in debug mode by @mingxwa in #329
- Update sample code links by @mingxwa in #328
- Fix build with GCC trunk by @mingxwa in #327
- Support bitwise trivial relocatability by @mingxwa in #330
- Allow dark theme on the website by @mingxwa in #331
- Improve
proxy_indirect_accessorby @mingxwa in #335 - Fix return type for prefix operator++ and operator-- by @mingxwa in #332
- Code cleanup by @mingxwa in #334
- Improve toolchain coverage by @mingxwa in #333
- Revise the semantics of ProAccessible by @mingxwa in #336
- Fix release pipeline by @mingxwa in #337
- Fix typo in the spec of
-
New Contributors
- @SidneyCogdill made their first contribution in #293
Full changelog: 3.4.0...4.0.0
Proxy 3.4.0 – Forward-compatibility release 🚀
3.4.0 adds no new APIs, but it paves the way for Proxy 4 and later majors.
What’s inside
-
Forward-compatibility scaffolding
- Public headers now live in a versioned inline namespace (
pro::v3). - Every macro has a major-qualified alias (e.g.
PRO3_DEF_MEM_DISPATCH). - Lets two majors coexist in one translation unit without ODR violations.
- Idea by @SidneyCogdill, implemented by @SidneyCogdill and @mingxwa.
- Public headers now live in a versioned inline namespace (
-
Toolchain fix
- Resolved a build failure on Clang 20 — thanks @iKoznov.
Upgrading
-
Treat 3.4.0 like any other 3.x patch/minor update; no code changes required.
-
After Proxy 4 ships, migrate module-by-module:
#include <proxy/v3/proxy.h> // current #include <proxy/v4/proxy.h> // new pro::v3::foo(); // existing code pro::v4::foo(); // migrated code
-
When every target depends only on v4, drop v3 and remove
pro::v3::qualifiers.
See the updated FAQ ("How do I upgrade Proxy in a large codebase?") for details.
Full changelog: 3.3.0...3.4.0
Proxy 3.3.0 Release
New Features 🌟
- Added facilities for shared/weak ownership by @mingxwa in #264:
- function template
make_proxy_shared: Similar to instantiating aproxywithstd::shared_ptr, but- Without additional type-erasure on the deleter,
- Having a more compact memory layout without requiring a separate control block,
- Without weak ownership support if not desired.
- function template
allocate_proxy_shared: Similar tomake_proxy_shared()while supports any custom allocators. - alias template
weak_proxyand class templateweak_facade: Specifyproxywith weak ownership. basic_facade_builder::support_weak: Specifies that afacadetypeFsupports conversion fromproxy<F>toweak_proxy<F>.
- function template
- function template
make_proxy_viewby @mingxwa in #265: Similar to creating aproxy_viewfrom a raw pointer, but honors constness and reference semantics. - concept
proxiable_targetby @mingxwa in #265: Specifies that a reference type can instantiate aproxy_view.
Quality Improvements 🔬
- Improved diagnostics by reducing constraints by @mingxwa in #262. Thanks to @SidneyCogdill for the great idea!
- Allowed creating
proxyfrom a null pointer by @mingxwa in #260 - Prefered static
operator()if available by @mingxwa in #267 - Constrained
proxywithfacadeby @mingxwa in #263 - Switched lifetime convention to standard dispatch model by @mingxwa in #269
- Aligned behavior of direct and indirect
proxy_invokewith rvalue reference by @mingxwa in #271
Toolchain Updates 🛠️
- Added benchmarks for shared ownership both in indirect invocation and lifetime management by @mingxwa in #264. Below are the numbers from a recent CI build:
| MSVC on Windows | GCC on Ubuntu | Clang on Ubuntu | Apple Clang on macOS | NVIDIA HPC on Ubuntu | |
|---|---|---|---|---|---|
Indirect invocation on small objects via proxy vs. virtual functions (shared ownership) |
🟢proxy is about 327.6% faster |
🟢proxy is about 83.2% faster |
🟢proxy is about 46.1% faster |
🟢proxy is about 26.8% faster |
🟢proxy is about 75.5% faster |
Indirect invocation on large objects via proxy vs. virtual functions (shared ownership) |
🟢proxy is about 165.3% faster |
🟢proxy is about 28.4% faster |
🟢proxy is about 20.8% faster |
🔴proxy is about 5.1% slower |
🟢proxy is about 8.6% faster |
Basic lifetime management for small objects with proxy (shared ownership) vs. std::shared_ptr (both without memory pool) |
🟢proxy is about 11.8% faster |
🟢proxy is about 10.8% faster |
🟢proxy is about 8.5% faster |
🟢proxy is about 37.5% faster |
🟢proxy is about 8.8% faster |
Basic lifetime management for small objects with proxy (shared ownership) vs. std::shared_ptr (both with memory pool) |
🟢proxy is about 5.7% faster |
🟡proxy is about 4.0% faster |
🟢proxy is about 21.5% faster |
🟢proxy is about 30.5% faster |
🟡proxy is about 1.6% faster |
Basic lifetime management for large objects with proxy (shared ownership) vs. std::shared_ptr (both without memory pool) |
🟢proxy is about 21.1% faster |
🟢proxy is about 6.0% faster |
🟡proxy is about 0.4% slower |
🟢proxy is about 48.9% faster |
🟢proxy is about 8.7% faster |
Basic lifetime management for large objects with proxy (shared ownership) vs. std::shared_ptr (both with memory pool) |
🟢proxy is about 17.7% faster |
🟢proxy is about 11.2% faster |
🟢proxy is about 29.1% faster |
🟢proxy is about 10.5% faster |
🟡proxy is about 4.5% faster |
- Attached environment information to benchmarking report by @mingxwa in #270
- Revised documentation for 3.3.0 by @mingxwa in #272
Full Changelog: 3.2.1...3.3.0
Proxy 3.2.1 Release
What's Changed
- Replaced
basic_facade_builder::add_view<F>intosupport_viewwithout requiring a template argument. - Reduced the semantics of
proxy_view. - Added type
facade_aware_overload_t. It allows specifying a facade-aware overload template (required for the implementation ofbasic_facade_builder::support_view). - Revised the ProOverload requirements.
Full Changelog
- Improve documentation formatting by @mingxwa in #235
- Improve documentation formatting by @mingxwa in #236
- Add support for facade-aware overloads by @mingxwa in #239
- Code cleanup by @mingxwa in #251
- Fix
swapfor trivial proxy by @mingxwa in #249 - Improve
proxy_viewby @mingxwa in #241 - Bypass proxiability check in unresolved context by @mingxwa in #255
- Update version in CMake by @mingxwa in #256
Proxy 3.2.0 Release
What's Changed
New Features
- Added extension
basic_facade_builder::support_rtti(enablingproxy_typeidandproxy_cast) for RTTI support as per @qq978358810 and @xuruilong100's feedback. - Added extensions
observer_facade,proxy_viewandbasic_facade_builder::add_viewfor non-owningproxytypes as per @Shuenhoy's feedback. - Added extensions
std::formatter<proxy_indirect_accessor>andbasic_facade_builder::support_format, enablingproxyto work with standard formatting functions such asstd::format. - Added class template
weak_dispatchas a replacement of macroPRO_DEF_WEAK_DISPATCH(deprecated since 3.2). - Added class template
proxy_indirect_accessor, representing the dereferenced state of aproxyobject.
Other Notable
- Revised the design of
conversion_dispatch. In the previous version,conversion_dispatchwas designed as a class template. It has been updated into 2 concrete typesexplicit_conversion_dispatch(aka.conversion_dispatch) andimplicit_conversion_dispatchwithout a template. - Revised the design of
proxy_invokeandproxy_reflect. - Fixed bug #219: ADL for free function accessors was broken for qualified overload resolution.
- Fixed bug #222:
std::in_place_type_toverload resolution was broken when a dispatch is not SFINAE-safe.
Full Changelog
- Improve the release pipeline by @tian-lt in #210
- Update CMakeLists.txt to the latest version by @tian-lt in #211
- Revise design of
conversion_dispatchby @mingxwa in #212 - Suppress unexpected compiler warnings by @mingxwa in #215
- Fix ADL for free function accessors by @mingxwa in #220
- Fix typo in
implicit_conversion_dispatch.mdby @mingxwa in #216 - Add support for
proxy_viewand complementary infrastructure by @mingxwa in #218 - Add direct support for RTTI by @mingxwa in #221
- Fix the
std::in_place_type_toverload for SFINAE-unsafe facades by @mingxwa in #223 - Replace macro
PRO_DEF_WEAK_DISPATCHwith class templateweak_dispatchby @mingxwa in #224 - Simplify
proxy_invokeandproxy_reflectby @mingxwa in #226 - Feature: Support for
std::formatby @mingxwa in #228 - Revise spec for version 3.2 by @mingxwa in #231
Proxy 3.1.0 Release
What's Changed
- Added macro
PRO_DEF_FREE_AS_MEM_DISPATCHto facilitate authoring a dispatch type of a free function, while providing accessibility through a member function. - Improved accessibility for reflection. Specifically,
- Added support for "accessors" in a custom reflector type. See function template
proxy_reflectfor more details. - Added support for "indirect" reflections, similar to conventions. See alias template
basic_facade_builder::add_reflectionfor more details. - Added the named requirements ProReflection.
- Added support for "accessors" in a custom reflector type. See function template
- Improved code generation in non-optimized builds to facilitate debugging. Specifically,
- Added assertions against null pointers in
proxy::proxy(),proxy_invoke(), andproxy_reflect(). - Added guidance to encourage compilers to generate code for accessibility, even if they are not used in a binary (see #200 and #202 for more details).
- Relaxed the named requirements ProAccessible to facilitate implementation of the debugging facilities.
- Added assertions against null pointers in
- Added benchmarks for the library. See Analyzing the Performance of the “Proxy” Library for more details.
- Added support for the NVIDIA HPC compiler as per @pedronahum's feedback. Specifically,
- Fixed unit tests to enable compilation with the NVIDIA HPC compiler.
- Added a new validation pipeline to ensure it won't regress.
- Updated README accordingly.
- Fixed unit tests when building with clang-cl on Windows as per @frederick-vs-ja's feedback.
- Improved documentation of some facilities. Specifically,
- Aligned wording of
allocate_proxy()andmake_proxy_inplace()with P3401R0. - Fixed typo in
basic_facade_builder::add_conventionby @ggqshr in #190. - Improved wording for
PRO_DEF_WEAK_DISPATCHas per @Shuenhoy's feedback.
- Aligned wording of
- Revised the semantics of
proxy_invoke()andproxy_reflect(). - Improved pipeline infrastructure to facilitate engineering. Specifically,
- Enabled automated benchmarking for CI builds.
- Updated macOS image version to 15.
- Updated Ubuntu image version to 24.04.
- Improved release pipeline to generate a
proxy-{version}.tgzpackage to facilitate consumption.
- Updated the value of feature test macro __msft_lib_proxy to
202410L.
New Contributors
Full Changelog
- Fix broken link by @mingxwa in #161
- Update wording for allocate_proxy and make_proxy_inplace by @mingxwa in #163
- Fix documentation format by @mingxwa in #166
- Reduce semantics of
proxy_invokeby @mingxwa in #167 - Update Ubuntu pipeline image by @mingxwa in #168
- Add benchmarks by @mingxwa in #169
- Resolve warnings in unit tests by @mingxwa in #173
- Pump library version by @mingxwa in #172
- Add assertion for
proxy_invoke()andproxy_reflect()by @mingxwa in #175 - [Build] Update macOS to 15 by @mingxwa in #176
- Improve benchmarking command line by @mingxwa in #177
- Force enable EBO on MSBuild when building with clang-cl by @mingxwa in #179
- Resolve build issues for NVHPC by @mingxwa in #182
- Generate benchmarking report by @mingxwa in #181
- Stabilize benchmarking report by @mingxwa in #183
- Implement
PRO_DEF_FREE_AS_MEM_DISPATCHby @mingxwa in #189 - Update add_convention.md by @ggqshr in #190
- Implement accessibility support for reflection by @mingxwa in #191
- Add pipeline for NVHPC by @mingxwa in #197
- Improve accessibility in debugging by @mingxwa in #200
- Refactor unit tests by @mingxwa in #201
- Improve accessibility in debugging for free functions by @mingxwa in #202
- Improve release pipeline by @mingxwa in #203
- Improve wording for PRO_DEF_WEAK_DISPATCH by @mingxwa in #204
- Fix release pipeline by @mingxwa in #205
- Fix NVIDIA trade name by @mingxwa in #206
3.0.0
Proxy 3.0.0 is Now Available!
Check out the new features in our announcement!
Please find more technical details with the following links:
- API Reference: https://microsoft.github.io/proxy/docs/specifications.html
- Frequently Asked Questions: https://microsoft.github.io/proxy/docs/faq.html
New Contributors
- @frederick-vs-ja made their first contribution in #59
- @alvarogalloc made their first contribution in #133
Full Changelog: 2.0.0...3.0.0
3.0.0-rc1
Proxy 3: Feature Complete
After evolving for around half a year, Proxy 3 is now feature complete, with the latest and greatest design for modern runtime polymorphism in C++. Full documentation will be available with the final release of version 3.0.0 soon. Please stay tuned.
What's Changed
- Fix helper macros for multiple signatures by @mingxwa in #96
- Fix UB in in-place construction by @mingxwa in #99
- Fix GCC pipeline by @mingxwa in #101
- Improve facade infrastructure by @mingxwa in #102
- Improve invocation APIs and facilities to define an operator dispatch by @mingxwa in #106
- Simulate overload resolution in macros by @mingxwa in #110
- Implement pointer-to-member support by @mingxwa in #111
- Refactoring: Improve code clarity by @mingxwa in #112
- Fix typo by @mingxwa in #114
- Implement indirection syntax by @mingxwa in #121
- Improve accessibility by @mingxwa in #124
- Move direction semantics from dispatches to conventions by @mingxwa in #125
- Revise semantics of
proxiable_ptr_constraintsby @mingxwa in #127 - Improve API design by @mingxwa in #128
- Make
facade_buildera class type, rather than a type alias by @mingxwa in #129 - Improve code quality by @mingxwa in #130
- fix referencing non-existent vcpkg website by @alvarogalloc in #133
- Revise
pro::facade_builder::restrict_layoutby @mingxwa in #132 - Refactor implementation of
meta_ptrby @mingxwa in #139 - Remove some macros by @mingxwa in #136
- Remove redundant macro
___PRO_DEF_BRACKETS_OP_ACCESSORby @mingxwa in #144 - Remove redundant semicolon by @mingxwa in #145
- Add feature test macro by @mingxwa in #146
- Add more samples by @mingxwa in #148
- Remove vcpkg.json in samples by @mingxwa in #149
- Run BVT with AppleClang by @mingxwa in #150
- Update Google test version by @mingxwa in #151
- Fix build error by @mingxwa in #153
- Add .gitattributes by @mingxwa in #155
New Contributors
- @alvarogalloc made their first contribution in #133
Full Changelog: 2.4.0...3.0.0-rc1
2.4.0
People want proxy.Fun() syntax. Now done.
Full Changelog: 2.3.2...2.4.0