From 901573a594e9be071159106dc3918970b1d29922 Mon Sep 17 00:00:00 2001 From: Mingxin Wang Date: Thu, 25 Sep 2025 12:56:10 +0800 Subject: [PATCH] Introduce new API: substitution_dispatch --- include/proxy/v4/proxy.h | 919 ++++++++++++++++---------------- include/proxy/v4/proxy_macros.h | 27 +- tests/proxy_dispatch_tests.cpp | 18 + 3 files changed, 482 insertions(+), 482 deletions(-) diff --git a/include/proxy/v4/proxy.h b/include/proxy/v4/proxy.h index 2223027e..0bb2cd35 100644 --- a/include/proxy/v4/proxy.h +++ b/include/proxy/v4/proxy.h @@ -40,6 +40,12 @@ #error Proxy requires C++20 attribute no_unique_address. #endif +#if __cpp_lib_unreachable >= 202202L +#define PROD_UNREACHABLE() std::unreachable() +#else +#define PROD_UNREACHABLE() std::abort() +#endif // __cpp_lib_unreachable >= 202202L + #if __cpp_trivial_relocatability >= 202502L #define PROD_TR_IF_ELIGIBLE trivially_relocatable_if_eligible #else @@ -48,6 +54,40 @@ namespace pro::inline v4 { +// ============================================================================= +// == Core Components (facade, proxy, etc.) == +// ============================================================================= + +namespace details { + +template +struct basic_facade_traits; + +} // namespace details + +enum class constraint_level { none, nontrivial, nothrow, trivial }; + +template