Skip to content
This repository was archived by the owner on Jan 29, 2026. It is now read-only.

Commit 7acdae1

Browse files
authored
Backport docs to 3.4 for compatibility (#312)
1 parent 20474cd commit 7acdae1

6 files changed

Lines changed: 30 additions & 1 deletion

File tree

docs/PRO_DEF_FREE_AS_MEM_DISPATCH.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ struct dispatch_name {
4545
}
4646
```
4747
48+
When headers from different major versions of the Proxy library can appear in the same translation unit (for example, Proxy 3 and Proxy 4), use the major-qualified form `PRO<major>_DEF_FREE_AS_MEM_DISPATCH` (e.g., `PRO3_DEF_FREE_AS_MEM_DISPATCH`).
49+
4850
## Example
4951
5052
```cpp

docs/PRO_DEF_FREE_DISPATCH.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ struct dispatch_name {
4343
}
4444
```
4545
46+
When headers from different major versions of the Proxy library can appear in the same translation unit (for example, Proxy 3 and Proxy 4), use the major-qualified form `PRO<major>_DEF_FREE_DISPATCH` (e.g., `PRO3_DEF_FREE_DISPATCH`).
47+
4648
## Example
4749
4850
```cpp

docs/PRO_DEF_MEM_DISPATCH.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ struct dispatch_name {
4545
}
4646
```
4747
48+
When headers from different major versions of the Proxy library can appear in the same translation unit (for example, Proxy 3 and Proxy 4), use the major-qualified form `PRO<major>_DEF_MEM_DISPATCH` (e.g., `PRO3_DEF_MEM_DISPATCH`).
49+
4850
## Example
4951
5052
```cpp

docs/faq.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
- [**Why is "Proxy" based on pointer semantics rather than value semantics like `std::function`?**](#why-pointer)
1212
- [**Why does "Proxy" define several macros instead of modern C++ facilities?**](#why-macros)
1313
- [**What is the standardization progress of this library?**](#standardization)
14+
- [**How do I upgrade "Proxy" in a large codebase?**](#how-upgrade)
1415
- [**What should I do if I found this library deficient in my scenario?**](#help-needed)
1516

1617
### <a name="what">What is "Proxy" and how does it work?</a>
@@ -62,6 +63,26 @@ At the beginning, we explored the feasibility of designing a general-purpose pol
6263

6364
Currently, there is [an ongoing proposal](https://wg21.link/p3086) being reviewed in the ISO C++ committee. The progress can be tracked [here](https://github.com/cplusplus/papers/issues/1741).
6465

66+
### <a name="how-upgrade">How do I upgrade "Proxy" in a large codebase?</a>
67+
68+
Upgrading a small component is usually straightforward, but migrating a monorepo or multi-module product can be challenging. Follow the guidelines below:
69+
70+
1. **Minor or patch upgrades (e.g. 3.3.0 → 3.4.0)**
71+
All 3.x.y releases preserve API/ABI compatibility, so different parts of the program may safely depend on different 3.x.y versions. No special action is required.
72+
73+
2. **Major upgrades (e.g. 3.4.0 → 4.0.0)**
74+
- If your current version is *earlier* than 3.4.0, migrate to 3.4.0 first.
75+
- Starting with 3.4.0, each major release is placed in a versioned inline namespace (`pro::v3`, `pro::v4`, …).  When a translation unit sees multiple majors, qualify the namespace explicitly:
76+
```cpp
77+
pro::v3::foo();   // Proxy 3 API
78+
pro::v4::foo();   // Proxy 4 API
79+
```
80+
The newest release re-exports its namespace as the inline (default) namespace, so unqualified calls (`pro::foo()`) resolve to the latest version once the migration is complete.
81+
- The macros also have major-qualified aliases, e.g. [`PRO3_DEF_MEM_DISPATCH`](PRO_DEF_MEM_DISPATCH.md). Use these forms whenever headers from multiple majors are included in the same translation unit.
82+
- Upgrade subsystems incrementally, module-by-module or DLL-by-DLL. When every target depends only on the new major, drop the old include path and remove the previous version from your build.
83+
84+
These rules let old and new code coexist during the transition while keeping ODR violations at bay.
85+
6586
### <a name="help-needed">What should I do if I found this library deficient in my scenario?</a>
6687

6788
Please search for your scenario in the existing issues first, and feel free to file an a new one on demand, following the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).

docs/msft_lib_proxy.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#define __msft_lib_proxy /* see below */
55
```
66
7-
Similar to the standard [feature test macros](https://en.cppreference.com/w/cpp/feature_test), library "Proxy" has defined a feature test macro since 3.0.0. The table below maps each release version number to the corresponding value of `__msft_lib_proxy`.
7+
Starting with 3.0.0, Proxy ships a feature-test macro that encodes the library version. When headers from different major versions of the Proxy library can appear in the same translation unit (for example, Proxy 3 and Proxy 4), use the major-qualified form `__msft_lib_proxy<major>` (e.g., `__msft_lib_proxy3`).
88
99
| Version | Value of `__msft_lib_proxy` |
1010
| ------- | --------------------------- |

docs/specifications.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
This document provides the API specifications for the C++ library Proxy (version 3). All the documented concepts, classes, and functions are defined in the namespace `pro`. Unless otherwise specified, all facilities are [freestanding](https://en.cppreference.com/w/cpp/freestanding) by default.
44

5+
*Since 3.4.0*: To support side-by-side installation of multiple major releases, each version of Proxy is wrapped in an inline namespace named after its major number. In a translation unit that includes both Proxy 3 and Proxy 4, the APIs can be referenced explicitly as `pro::v3::foo` or `pro::v4::foo` The current release exports `v3` as the inline (default) namespace, so unqualified names resolve to `pro::v3`.
6+
57
## Concepts
68

79
| Name | Description |

0 commit comments

Comments
 (0)