Microsoft has launched Proxy 4, an replace of its Proxy library for runtime polymorphism within the C++ language. The brand new launch introduces constructing blocks for composing facades, aliases to specific borrowing and weak possession patterns, helpers for effectively creating shared and weak proxies, and extra.
Proxy 4 was introduced August 19. Discovered on GitHub, Proxy is described as a header-only, cross-platform C++20 library for writing polymorphic code with out the ache of inheritance or the restrictions of conventional digital capabilities.
Proxy 4 introduces handy aliases for non-owning and weak references, proxy_view
and weak_proxy
. These are constructed atop the core proxy
idea, making it simpler to specific borrowing and weak possession patterns in code, Microsoft stated. For instance, builders can use proxy_view
to soundly borrow an object with out taking possession, or weak proxy
to construct a weak reference that may be locked when essential.