Microsoft has released Proxy 4, an update of its Proxy library for runtime polymorphism in the C++ language. The new release introduces building blocks for composing facades, aliases to express borrowing and weak ownership patterns, helpers for efficiently creating shared and weak proxies, and more.
Proxy 4 was announced August 19. Found on GitHub, Proxy is described as a header-only, cross-platform C++20 library for writing polymorphic code without the pain of inheritance or the limitations of traditional virtual functions.
Proxy 4 introduces convenient aliases for non-owning and weak references, proxy_view
and weak_proxy
. These are built atop the core proxy
concept, making it easier to express borrowing and weak ownership patterns in code, Microsoft said. For example, developers can use proxy_view
to safely borrow an object without taking ownership, or weak proxy
to build a weak reference that can be locked when necessary.