diff --git a/CMakeLists.txt b/CMakeLists.txt index 39426617..7b17bc61 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,9 +1,9 @@ cmake_minimum_required(VERSION 3.28) -project(msft_proxy4 VERSION 4.1.0 LANGUAGES CXX) -add_library(msft_proxy4 INTERFACE) -set_target_properties(msft_proxy4 PROPERTIES EXPORT_NAME proxy) -add_library(msft_proxy4::proxy ALIAS msft_proxy4) +project(msft_proxy5 VERSION 5.0.0 LANGUAGES CXX) +add_library(msft_proxy5 INTERFACE) +set_target_properties(msft_proxy5 PROPERTIES EXPORT_NAME proxy) +add_library(msft_proxy5::proxy ALIAS msft_proxy5) # Do not enable building tests if proxy is consumed as # subdirectory (e.g. by CMake FetchContent_Declare). @@ -39,7 +39,7 @@ endif() file(GLOB_RECURSE proxy_public_headers CONFIGURE_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/include/proxy/*.h" "${CMAKE_CURRENT_SOURCE_DIR}/include/proxy/*.ixx") -target_sources(msft_proxy4 +target_sources(msft_proxy5 INTERFACE FILE_SET public_headers TYPE HEADERS @@ -47,9 +47,9 @@ target_sources(msft_proxy4 FILES ${proxy_public_headers} ) -target_compile_features(msft_proxy4 INTERFACE cxx_std_20) +target_compile_features(msft_proxy5 INTERFACE cxx_std_20) target_include_directories( - msft_proxy4 + msft_proxy5 INTERFACE $ $ @@ -57,13 +57,13 @@ target_include_directories( # Do not set the module target if proxy is consumed as a subdirectory. if(PROJECT_IS_TOP_LEVEL) - set(msft_proxy4_INCLUDE_DIR include) + set(msft_proxy5_INCLUDE_DIR include) if(PROXY_BUILD_MODULES) - include(cmake/msft_proxy4ModuleTargets.cmake) + include(cmake/msft_proxy5ModuleTargets.cmake) endif() else() # Propagate the variable to the parent project - set(msft_proxy4_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/include PARENT_SCOPE) + set(msft_proxy5_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/include PARENT_SCOPE) endif() # install and export the project. project name - proxy @@ -71,42 +71,42 @@ endif() include(GNUInstallDirs) install( - TARGETS msft_proxy4 - EXPORT msft_proxy4Targets + TARGETS msft_proxy5 + EXPORT msft_proxy5Targets FILE_SET public_headers DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} ) install( - EXPORT msft_proxy4Targets - NAMESPACE msft_proxy4:: - DESTINATION ${CMAKE_INSTALL_DATADIR}/msft_proxy4 + EXPORT msft_proxy5Targets + NAMESPACE msft_proxy5:: + DESTINATION ${CMAKE_INSTALL_DATADIR}/msft_proxy5 ) export( - TARGETS msft_proxy4 - NAMESPACE msft_proxy4:: - FILE msft_proxy4Targets.cmake + TARGETS msft_proxy5 + NAMESPACE msft_proxy5:: + FILE msft_proxy5Targets.cmake ) include(CMakePackageConfigHelpers) configure_package_config_file( - cmake/msft_proxy4Config.cmake.in - ${CMAKE_CURRENT_BINARY_DIR}/cmake/msft_proxy4Config.cmake - INSTALL_DESTINATION ${CMAKE_INSTALL_DATADIR}/msft_proxy4 + cmake/msft_proxy5Config.cmake.in + ${CMAKE_CURRENT_BINARY_DIR}/cmake/msft_proxy5Config.cmake + INSTALL_DESTINATION ${CMAKE_INSTALL_DATADIR}/msft_proxy5 PATH_VARS CMAKE_INSTALL_INCLUDEDIR ) include(CMakePackageConfigHelpers) write_basic_package_version_file( - cmake/msft_proxy4ConfigVersion.cmake + cmake/msft_proxy5ConfigVersion.cmake COMPATIBILITY SameMajorVersion ARCH_INDEPENDENT ) install( FILES - ${CMAKE_CURRENT_BINARY_DIR}/cmake/msft_proxy4Config.cmake - ${CMAKE_CURRENT_BINARY_DIR}/cmake/msft_proxy4ConfigVersion.cmake - DESTINATION ${CMAKE_INSTALL_DATADIR}/msft_proxy4 + ${CMAKE_CURRENT_BINARY_DIR}/cmake/msft_proxy5Config.cmake + ${CMAKE_CURRENT_BINARY_DIR}/cmake/msft_proxy5ConfigVersion.cmake + DESTINATION ${CMAKE_INSTALL_DATADIR}/msft_proxy5 ) # build tests if BUILD_TESTING is ON diff --git a/MODULE.bazel b/MODULE.bazel index f87e3792..d4598864 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -1,6 +1,6 @@ module( name = "proxy", - version = "4.1.0", + version = "5.0.0", ) bazel_dep(name = "platforms", version = "1.1.0") diff --git a/README.md b/README.md index 35fbd4bf..9ee25a95 100644 --- a/README.md +++ b/README.md @@ -242,12 +242,12 @@ Fetch via [CPM](https://github.com/cpm-cmake/CPM.cmake) (a thin wrapper over CMa ```cmake CPMAddPackage( - NAME msft_proxy4 - GIT_TAG 4.1.0 + NAME msft_proxy5 + GIT_TAG 5.0.0 GIT_REPOSITORY https://github.com/ngcpp/proxy.git ) -target_link_libraries(main PRIVATE msft_proxy4::proxy) +target_link_libraries(main PRIVATE msft_proxy5::proxy) ``` Or, if you already have a local clone, use `add_subdirectory(path/to/proxy)` instead of `CPMAddPackage`. @@ -259,17 +259,17 @@ Place a wrap file at `subprojects/proxy.wrap` and Meson will fetch the source au ```ini [wrap-git] url = https://github.com/ngcpp/proxy.git -revision = 4.1.0 +revision = 5.0.0 [provide] -dependency_names = msft_proxy4 +dependency_names = msft_proxy5 ``` Then in your `meson.build`: ```meson -msft_proxy4_dep = dependency('msft_proxy4') -executable('main', 'main.cpp', dependencies: msft_proxy4_dep) +msft_proxy5_dep = dependency('msft_proxy5') +executable('main', 'main.cpp', dependencies: msft_proxy5_dep) ``` ### Bazel @@ -279,7 +279,7 @@ The library is not yet published to the [Bazel Central Registry](https://registr With **Bzlmod** (Bazel 7+), add to your `MODULE.bazel`: ```python -bazel_dep(name = "proxy", version = "4.1.0") +bazel_dep(name = "proxy", version = "5.0.0") git_override( module_name = "proxy", remote = "https://github.com/ngcpp/proxy.git", @@ -294,7 +294,7 @@ load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository") git_repository( name = "proxy", remote = "https://github.com/ngcpp/proxy.git", - tag = "4.1.0", + tag = "5.0.0", ) load("@proxy//:proxy_deps.bzl", "proxy_deps") proxy_deps() diff --git a/benchmarks/CMakeLists.txt b/benchmarks/CMakeLists.txt index 859ea8da..74dccea4 100644 --- a/benchmarks/CMakeLists.txt +++ b/benchmarks/CMakeLists.txt @@ -28,7 +28,7 @@ add_executable( target_include_directories(msft_proxy_benchmarks PRIVATE .) target_link_libraries( msft_proxy_benchmarks - PRIVATE msft_proxy4::proxy benchmark::benchmark benchmark::benchmark_main + PRIVATE msft_proxy5::proxy benchmark::benchmark benchmark::benchmark_main ) target_compile_options( msft_proxy_benchmarks diff --git a/benchmarks/meson.build b/benchmarks/meson.build index 7e6e8ae2..c5ef29a7 100644 --- a/benchmarks/meson.build +++ b/benchmarks/meson.build @@ -8,7 +8,7 @@ benchmark( 'proxy_operation_benchmark_context.cpp', ), implicit_include_directories: false, - dependencies: [msft_proxy4_dep, benchmark_dep], + dependencies: [msft_proxy5_dep, benchmark_dep], cpp_args: cxx.get_argument_syntax() == 'msvc' ? ['/bigobj'] : [], ), ) diff --git a/cmake/msft_proxy4Config.cmake.in b/cmake/msft_proxy4Config.cmake.in deleted file mode 100644 index 7b4e8bb3..00000000 --- a/cmake/msft_proxy4Config.cmake.in +++ /dev/null @@ -1,5 +0,0 @@ -@PACKAGE_INIT@ - -include("${CMAKE_CURRENT_LIST_DIR}/msft_proxy4Targets.cmake") - -set(msft_proxy4_INCLUDE_DIR "@PACKAGE_CMAKE_INSTALL_INCLUDEDIR@") diff --git a/cmake/msft_proxy4ModuleTargets.cmake b/cmake/msft_proxy4ModuleTargets.cmake deleted file mode 100644 index 9c7da06d..00000000 --- a/cmake/msft_proxy4ModuleTargets.cmake +++ /dev/null @@ -1,34 +0,0 @@ -if(NOT DEFINED msft_proxy4_INCLUDE_DIR) - message( - FATAL_ERROR - "`msft_proxy4_INCLUDE_DIR` must be defined to use this script." - ) -endif() - -message( - STATUS - "Declaring `msft_proxy4::proxy_module` target for include path `${msft_proxy4_INCLUDE_DIR}`" -) - -add_library(msft_proxy4_module) -set_target_properties( - msft_proxy4_module - PROPERTIES SYSTEM TRUE EXCLUDE_FROM_ALL TRUE -) - -add_library(msft_proxy4::proxy_module ALIAS msft_proxy4_module) -target_sources( - msft_proxy4_module - PUBLIC - FILE_SET CXX_MODULES - BASE_DIRS ${msft_proxy4_INCLUDE_DIR} - FILES ${msft_proxy4_INCLUDE_DIR}/proxy/v4/proxy.ixx -) -target_compile_features(msft_proxy4_module PUBLIC cxx_std_20) -target_compile_options( - msft_proxy4_module - PRIVATE - $<$:/utf-8> - $<$:-Wno-c++2b-extensions> -) -target_link_libraries(msft_proxy4_module PUBLIC msft_proxy4::proxy) diff --git a/cmake/msft_proxy5Config.cmake.in b/cmake/msft_proxy5Config.cmake.in new file mode 100644 index 00000000..c6daff7d --- /dev/null +++ b/cmake/msft_proxy5Config.cmake.in @@ -0,0 +1,5 @@ +@PACKAGE_INIT@ + +include("${CMAKE_CURRENT_LIST_DIR}/msft_proxy5Targets.cmake") + +set(msft_proxy5_INCLUDE_DIR "@PACKAGE_CMAKE_INSTALL_INCLUDEDIR@") diff --git a/cmake/msft_proxy5ModuleTargets.cmake b/cmake/msft_proxy5ModuleTargets.cmake new file mode 100644 index 00000000..fdc4292f --- /dev/null +++ b/cmake/msft_proxy5ModuleTargets.cmake @@ -0,0 +1,34 @@ +if(NOT DEFINED msft_proxy5_INCLUDE_DIR) + message( + FATAL_ERROR + "`msft_proxy5_INCLUDE_DIR` must be defined to use this script." + ) +endif() + +message( + STATUS + "Declaring `msft_proxy5::proxy_module` target for include path `${msft_proxy5_INCLUDE_DIR}`" +) + +add_library(msft_proxy5_module) +set_target_properties( + msft_proxy5_module + PROPERTIES SYSTEM TRUE EXCLUDE_FROM_ALL TRUE +) + +add_library(msft_proxy5::proxy_module ALIAS msft_proxy5_module) +target_sources( + msft_proxy5_module + PUBLIC + FILE_SET CXX_MODULES + BASE_DIRS ${msft_proxy5_INCLUDE_DIR} + FILES ${msft_proxy5_INCLUDE_DIR}/proxy/v5/proxy.ixx +) +target_compile_features(msft_proxy5_module PUBLIC cxx_std_20) +target_compile_options( + msft_proxy5_module + PRIVATE + $<$:/utf-8> + $<$:-Wno-c++2b-extensions> +) +target_link_libraries(msft_proxy5_module PUBLIC msft_proxy5::proxy) diff --git a/docs/CMakeLists.txt b/docs/CMakeLists.txt index 2034fb01..d4e622ee 100644 --- a/docs/CMakeLists.txt +++ b/docs/CMakeLists.txt @@ -60,7 +60,7 @@ foreach(i RANGE 0 ${_last}) add_executable(example_${_suffix} "${_cpp}") target_link_libraries( example_${_suffix} - PRIVATE msft_proxy4::proxy ${_dep_names} + PRIVATE msft_proxy5::proxy ${_dep_names} ) target_compile_options(example_${_suffix} PRIVATE ${PROXY_BUILD_FLAGS}) add_test(NAME example_${_suffix} COMMAND example_${_suffix}) diff --git a/docs/faq.md b/docs/faq.md index 5d488882..a22f7de6 100644 --- a/docs/faq.md +++ b/docs/faq.md @@ -77,15 +77,15 @@ Upgrading a small component is usually straightforward, but migrating a monorepo 1. **Minor or patch upgrades (e.g. 3.3.0 → 3.4.0)** 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. -2. **Major upgrades (e.g. 3.4.0 → 4.0.0)** +2. **Major upgrades (e.g. 4.1.0 → 5.0.0)** - If your current version is *earlier* than 3.4.0, migrate to 3.4.0 first. - - 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: + - Starting with 3.4.0, each major release is placed in a versioned inline namespace (`pro::v3`, `pro::v4`, `pro::v5`, …).  When a translation unit sees multiple majors, qualify the namespace explicitly: ```cpp - pro::v3::foo(); // Proxy 3 API pro::v4::foo(); // Proxy 4 API + pro::v5::foo(); // Proxy 5 API ``` 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. - - The macros also have major-qualified aliases, e.g. [`PRO4_DEF_MEM_DISPATCH`](spec/PRO_DEF_MEM_DISPATCH.md). Use these forms whenever headers from multiple majors are included in the same translation unit. + - The macros also have major-qualified aliases, e.g. [`PRO5_DEF_MEM_DISPATCH`](spec/PRO_DEF_MEM_DISPATCH.md). Use these forms whenever headers from multiple majors are included in the same translation unit. - 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. These rules let old and new code coexist during the transition while keeping ODR violations at bay. diff --git a/docs/meson.build b/docs/meson.build index e9b0aeab..f1f7a5cc 100644 --- a/docs/meson.build +++ b/docs/meson.build @@ -31,7 +31,7 @@ foreach line : _gen.stdout().split('\n') ), extra_files: md, implicit_include_directories: false, - dependencies: [msft_proxy4_dep] + extra_deps, + dependencies: [msft_proxy5_dep] + extra_deps, build_by_default: false, ) examples += _ex diff --git a/docs/modules_support.md b/docs/modules_support.md index 00b63700..816bcc7c 100644 --- a/docs/modules_support.md +++ b/docs/modules_support.md @@ -7,43 +7,43 @@ The "Proxy" library ships with `.ixx` files starting with version **4.0.0**. Com As of 2025-05-11, CMake lacks support for forward compatibility when consuming C++ modules, which causes consumers with newer C++ standard to be unable to use modules with older standard. Until this is implemented by CMake, a CMake target containing the module can be manually declared using the following CMake script: ```cmake -find_package(msft_proxy4 REQUIRED) +find_package(msft_proxy5 REQUIRED) -if(NOT DEFINED msft_proxy4_INCLUDE_DIR) # (1) - if(NOT DEFINED msft_proxy4_SOURCE_DIR) - message(FATAL_ERROR "`msft_proxy4_INCLUDE_DIR` or `msft_proxy4_SOURCE_DIR` must be defined to use this script.") +if(NOT DEFINED msft_proxy5_INCLUDE_DIR) # (1) + if(NOT DEFINED msft_proxy5_SOURCE_DIR) + message(FATAL_ERROR "`msft_proxy5_INCLUDE_DIR` or `msft_proxy5_SOURCE_DIR` must be defined to use this script.") endif() - set(msft_proxy4_INCLUDE_DIR ${msft_proxy4_SOURCE_DIR}/include) + set(msft_proxy5_INCLUDE_DIR ${msft_proxy5_SOURCE_DIR}/include) endif() -message(STATUS "Declaring `msft_proxy4::proxy_module` target for include path `${msft_proxy4_INCLUDE_DIR}`") +message(STATUS "Declaring `msft_proxy5::proxy_module` target for include path `${msft_proxy5_INCLUDE_DIR}`") -add_library(msft_proxy4_module) +add_library(msft_proxy5_module) set_target_properties( - msft_proxy4_module + msft_proxy5_module PROPERTIES SYSTEM TRUE EXCLUDE_FROM_ALL TRUE ) -add_library(msft_proxy4::proxy_module ALIAS msft_proxy4_module) -target_sources(msft_proxy4_module PUBLIC +add_library(msft_proxy5::proxy_module ALIAS msft_proxy5_module) +target_sources(msft_proxy5_module PUBLIC FILE_SET CXX_MODULES - BASE_DIRS ${msft_proxy4_INCLUDE_DIR} + BASE_DIRS ${msft_proxy5_INCLUDE_DIR} FILES - ${msft_proxy4_INCLUDE_DIR}/proxy/v4/proxy.ixx + ${msft_proxy5_INCLUDE_DIR}/proxy/v5/proxy.ixx ) -target_compile_features(msft_proxy4_module PUBLIC cxx_std_20) # (2) -target_link_libraries(msft_proxy4_module PUBLIC msft_proxy4::proxy) +target_compile_features(msft_proxy5_module PUBLIC cxx_std_20) # (2) +target_link_libraries(msft_proxy5_module PUBLIC msft_proxy5::proxy) ``` -- (1) `msft_proxy4_INCLUDE_DIR` is automatically declared after `find_package(msft_proxy4)`. CPM uses a slightly different convention where `msft_proxy4_SOURCE_DIR` is declared after `CPMAddPackage`. -- (2) The C++ standard version for `msft_proxy4_module` target should be the same or higher than the consumer CMake target. For example if your project is using C++23 mode, this line should be changed to `cxx_std_23` or `cxx_std_26` / newer standards. +- (1) `msft_proxy5_INCLUDE_DIR` is automatically declared after `find_package(msft_proxy5)`. CPM uses a slightly different convention where `msft_proxy5_SOURCE_DIR` is declared after `CPMAddPackage`. +- (2) The C++ standard version for `msft_proxy5_module` target should be the same or higher than the consumer CMake target. For example if your project is using C++23 mode, this line should be changed to `cxx_std_23` or `cxx_std_26` / newer standards. It can then be consumed like this: ```cmake -target_link_libraries(main PRIVATE msft_proxy4::proxy_module) +target_link_libraries(main PRIVATE msft_proxy5::proxy_module) ``` ## Example @@ -60,7 +60,7 @@ module; export module dictionary; -import proxy.v4; // (3) +import proxy.v5; // (3) extern "C++" { // (4) PRO_DEF_MEM_DISPATCH(MemAt, at); @@ -79,7 +79,7 @@ Client: #include #include -import proxy.v4; +import proxy.v5; import dictionary; int main() { @@ -92,5 +92,5 @@ int main() { - (1) This is a traditional header rather than a module. It should be declared in global fragment (after `module` and before `export module`). - (2) This makes all `PRO_DEF_` macros available. This header file contains only some macros and are therefore very fast to compile. -- (3) `import proxy.v4;` makes all public interfaces from `pro::v4` namespace available in the current translation unit. +- (3) `import proxy.v5;` makes all public interfaces from `pro::v5` namespace available in the current translation unit. - (4) As of 2025-05-11, clangd requires the accessor struct to be either `export`-ed, or be declared within an `extern "C++"` block, in order to have auto completion working. diff --git a/docs/spec/PRO_DEF_FREE_AS_MEM_DISPATCH.md b/docs/spec/PRO_DEF_FREE_AS_MEM_DISPATCH.md index 8745fa79..7c6c52d3 100644 --- a/docs/spec/PRO_DEF_FREE_AS_MEM_DISPATCH.md +++ b/docs/spec/PRO_DEF_FREE_AS_MEM_DISPATCH.md @@ -48,7 +48,7 @@ struct dispatch_name { } ``` -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_DEF_FREE_AS_MEM_DISPATCH` (e.g., `PRO4_DEF_FREE_AS_MEM_DISPATCH`). +When headers from different major versions of the Proxy library can appear in the same translation unit (for example, Proxy 4 and Proxy 5), use the major-qualified form `PRO_DEF_FREE_AS_MEM_DISPATCH` (e.g., `PRO5_DEF_FREE_AS_MEM_DISPATCH`). ## Example diff --git a/docs/spec/PRO_DEF_FREE_DISPATCH.md b/docs/spec/PRO_DEF_FREE_DISPATCH.md index 0bdca881..272aeca2 100644 --- a/docs/spec/PRO_DEF_FREE_DISPATCH.md +++ b/docs/spec/PRO_DEF_FREE_DISPATCH.md @@ -45,7 +45,7 @@ struct dispatch_name { } ``` -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_DEF_FREE_DISPATCH` (e.g., `PRO4_DEF_FREE_DISPATCH`). +When headers from different major versions of the Proxy library can appear in the same translation unit (for example, Proxy 4 and Proxy 5), use the major-qualified form `PRO_DEF_FREE_DISPATCH` (e.g., `PRO5_DEF_FREE_DISPATCH`). ## Example diff --git a/docs/spec/PRO_DEF_MEM_DISPATCH.md b/docs/spec/PRO_DEF_MEM_DISPATCH.md index a53f86af..aab0834a 100644 --- a/docs/spec/PRO_DEF_MEM_DISPATCH.md +++ b/docs/spec/PRO_DEF_MEM_DISPATCH.md @@ -47,7 +47,7 @@ struct dispatch_name { } ``` -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_DEF_MEM_DISPATCH` (e.g., `PRO4_DEF_MEM_DISPATCH`). +When headers from different major versions of the Proxy library can appear in the same translation unit (for example, Proxy 4 and Proxy 5), use the major-qualified form `PRO_DEF_MEM_DISPATCH` (e.g., `PRO5_DEF_MEM_DISPATCH`). ## Example diff --git a/docs/spec/README.md b/docs/spec/README.md index 9b31bb04..4254cd10 100644 --- a/docs/spec/README.md +++ b/docs/spec/README.md @@ -1,8 +1,8 @@ -# Proxy 4 Specifications +# Proxy 5 Specifications -This document provides the API specifications for the C++ library Proxy (version 4). 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. +This document provides the API specifications for the C++ library Proxy (version 5). 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. -*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 `v4` as the inline (default) namespace, so unqualified names resolve to `pro::v4`. +*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 4 and Proxy 5, the APIs can be referenced explicitly as `pro::v4::foo` or `pro::v5::foo` The current release exports `v5` as the inline (default) namespace, so unqualified names resolve to `pro::v5`. ## Header `` diff --git a/docs/spec/allocate_proxy.md b/docs/spec/allocate_proxy.md index 1b64913f..c2436a10 100644 --- a/docs/spec/allocate_proxy.md +++ b/docs/spec/allocate_proxy.md @@ -2,7 +2,7 @@ > Header: `proxy.h` > Module: `proxy` -> Namespace: `pro::inline v4` +> Namespace: `pro::inline v5` The definition of `allocate_proxy` makes use of an exposition-only class template *allocated-ptr*. An object of type *allocated-ptr<T, Alloc>* allocates the storage for another object of type `T` with an allocator of type `Alloc` and manages the lifetime of this contained object. Similar to [`std::optional`](https://en.cppreference.com/w/cpp/utility/optional), *allocated-ptr<T, Alloc>* provides `operator*` for accessing the managed object of type `T` with the same qualifiers, but does not necessarily support the state where the contained object is absent. diff --git a/docs/spec/allocate_proxy_shared.md b/docs/spec/allocate_proxy_shared.md index 7bfd32b7..84b90ddb 100644 --- a/docs/spec/allocate_proxy_shared.md +++ b/docs/spec/allocate_proxy_shared.md @@ -2,7 +2,7 @@ > Header: `proxy.h` > Module: `proxy` -> Namespace: `pro::inline v4` +> Namespace: `pro::inline v5` > Since: 3.3.0 The definition of `allocate_proxy_shared` makes use of exposition-only class templates *strong-compact-ptr* and *weak-compact-ptr*. Their semantics are similar to [`std::shared_ptr`](https://en.cppreference.com/w/cpp/memory/shared_ptr) and [`std::weak_ptr`](https://en.cppreference.com/w/cpp/memory/weak_ptr), but do not provide a polymorphic deleter. Their size and alignment are guaranteed not to be greater than those of a raw pointer type. *strong-compact-ptr<T, Alloc>* is conditionally convertible to *weak-compact-ptr<T, Alloc>* only if necessary. Similar to [`std::optional`](https://en.cppreference.com/w/cpp/utility/optional), *strong-compact-ptr<T, Alloc>* provides `operator*` for accessing the managed object of type `T` with the same qualifiers. diff --git a/docs/spec/bad_proxy_cast.md b/docs/spec/bad_proxy_cast.md index 0ebd9cb9..9503c582 100644 --- a/docs/spec/bad_proxy_cast.md +++ b/docs/spec/bad_proxy_cast.md @@ -2,7 +2,7 @@ > Header: `proxy.h` > Module: `proxy` -> Namespace: `pro::inline v4` +> Namespace: `pro::inline v5` > Since: 3.2.0 ```cpp diff --git a/docs/spec/basic_facade_builder/README.md b/docs/spec/basic_facade_builder/README.md index fb45b21e..92be27ab 100644 --- a/docs/spec/basic_facade_builder/README.md +++ b/docs/spec/basic_facade_builder/README.md @@ -2,7 +2,7 @@ > Header: `proxy.h` > Module: `proxy` -> Namespace: `pro::inline v4` +> Namespace: `pro::inline v5` The definitions of `basic_facade_builder` and `facade_builder` make use of the following exposition-only constants: diff --git a/docs/spec/constraint_level.md b/docs/spec/constraint_level.md index 0c4c3904..008e6ebd 100644 --- a/docs/spec/constraint_level.md +++ b/docs/spec/constraint_level.md @@ -2,7 +2,7 @@ > Header: `proxy.h` > Module: `proxy` -> Namespace: `pro::inline v4` +> Namespace: `pro::inline v5` ```cpp enum class constraint_level : /* unspecified */ { diff --git a/docs/spec/explicit_conversion_dispatch/README.md b/docs/spec/explicit_conversion_dispatch/README.md index 0b9fe137..3af632a1 100644 --- a/docs/spec/explicit_conversion_dispatch/README.md +++ b/docs/spec/explicit_conversion_dispatch/README.md @@ -2,7 +2,7 @@ > Header: `proxy.h` > Module: `proxy` -> Namespace: `pro::inline v4` +> Namespace: `pro::inline v5` > Since: 3.2.0 ```cpp diff --git a/docs/spec/facade.md b/docs/spec/facade.md index 7c8d9184..9277c5ef 100644 --- a/docs/spec/facade.md +++ b/docs/spec/facade.md @@ -2,7 +2,7 @@ > Header: `proxy.h` > Module: `proxy` -> Namespace: `pro::inline v4` +> Namespace: `pro::inline v5` ```cpp template diff --git a/docs/spec/facade_aware_overload_t.md b/docs/spec/facade_aware_overload_t.md index 8579a5e9..f1004025 100644 --- a/docs/spec/facade_aware_overload_t.md +++ b/docs/spec/facade_aware_overload_t.md @@ -2,7 +2,7 @@ > Header: `proxy.h` > Module: `proxy` -> Namespace: `pro::inline v4` +> Namespace: `pro::inline v5` > Since: 3.2.1 ```cpp diff --git a/docs/spec/implicit_conversion_dispatch/README.md b/docs/spec/implicit_conversion_dispatch/README.md index 7b801500..057af758 100644 --- a/docs/spec/implicit_conversion_dispatch/README.md +++ b/docs/spec/implicit_conversion_dispatch/README.md @@ -2,7 +2,7 @@ > Header: `proxy.h` > Module: `proxy` -> Namespace: `pro::inline v4` +> Namespace: `pro::inline v5` > Since: 3.2.0 ```cpp diff --git a/docs/spec/inplace_proxiable_target.md b/docs/spec/inplace_proxiable_target.md index d3179f1c..c93d5fc1 100644 --- a/docs/spec/inplace_proxiable_target.md +++ b/docs/spec/inplace_proxiable_target.md @@ -2,7 +2,7 @@ > Header: `proxy.h` > Module: `proxy` -> Namespace: `pro::inline v4` +> Namespace: `pro::inline v5` ```cpp template diff --git a/docs/spec/is_bitwise_trivially_relocatable.md b/docs/spec/is_bitwise_trivially_relocatable.md index a344ea6f..a41b7508 100644 --- a/docs/spec/is_bitwise_trivially_relocatable.md +++ b/docs/spec/is_bitwise_trivially_relocatable.md @@ -2,7 +2,7 @@ > Header: `proxy.h` > Module: `proxy` -> Namespace: `pro::inline v4` +> Namespace: `pro::inline v5` > Since: 4.0.0 ```cpp diff --git a/docs/spec/make_proxy.md b/docs/spec/make_proxy.md index 3db05d4f..561d8e5a 100644 --- a/docs/spec/make_proxy.md +++ b/docs/spec/make_proxy.md @@ -2,7 +2,7 @@ > Header: `proxy.h` > Module: `proxy` -> Namespace: `pro::inline v4` +> Namespace: `pro::inline v5` The definitions of `make_proxy` make use of the following exposition-only function: diff --git a/docs/spec/make_proxy_inplace.md b/docs/spec/make_proxy_inplace.md index b8928e2a..8fd5f3f2 100644 --- a/docs/spec/make_proxy_inplace.md +++ b/docs/spec/make_proxy_inplace.md @@ -2,7 +2,7 @@ > Header: `proxy.h` > Module: `proxy` -> Namespace: `pro::inline v4` +> Namespace: `pro::inline v5` The definition of `make_proxy_inplace` makes use of an exposition-only class template *inplace-ptr*. Similar to [`std::optional`](https://en.cppreference.com/w/cpp/utility/optional), *inplace-ptr<T>* contains the storage for an object of type `T`, manages its lifetime, and provides `operator*` for access with the same qualifiers. However, it does not necessarily support the state where the contained object is absent. *inplace-ptr<T>* has the same size and alignment as `T`. diff --git a/docs/spec/make_proxy_shared.md b/docs/spec/make_proxy_shared.md index 3a50dbdd..b8c07817 100644 --- a/docs/spec/make_proxy_shared.md +++ b/docs/spec/make_proxy_shared.md @@ -2,7 +2,7 @@ > Header: `proxy.h` > Module: `proxy` -> Namespace: `pro::inline v4` +> Namespace: `pro::inline v5` > Since: 3.3.0 ```cpp diff --git a/docs/spec/make_proxy_view.md b/docs/spec/make_proxy_view.md index 9a7cae5c..102111e8 100644 --- a/docs/spec/make_proxy_view.md +++ b/docs/spec/make_proxy_view.md @@ -2,7 +2,7 @@ > Header: `proxy.h` > Module: `proxy` -> Namespace: `pro::inline v4` +> Namespace: `pro::inline v5` > Since: 3.3.0 The definition of `make_proxy_view` makes use of an exposition-only class template *observer-ptr*. `observer-ptr` contains a raw pointer to an object of type `T`, and provides `operator*` for access with the same qualifiers. diff --git a/docs/spec/msft_lib_proxy.md b/docs/spec/msft_lib_proxy.md index 31906ccf..01420c4c 100644 --- a/docs/spec/msft_lib_proxy.md +++ b/docs/spec/msft_lib_proxy.md @@ -6,7 +6,7 @@ #define __msft_lib_proxy /* see below */ ``` -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` (e.g., `__msft_lib_proxy4`). +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 4 and Proxy 5), use the major-qualified form `__msft_lib_proxy` (e.g., `__msft_lib_proxy5`). | Version | Value of `__msft_lib_proxy` | | ------- | --------------------------- | diff --git a/docs/spec/operator_dispatch/README.md b/docs/spec/operator_dispatch/README.md index 35c71703..ab2cbc07 100644 --- a/docs/spec/operator_dispatch/README.md +++ b/docs/spec/operator_dispatch/README.md @@ -2,7 +2,7 @@ > Header: `proxy.h` > Module: `proxy` -> Namespace: `pro::inline v4` +> Namespace: `pro::inline v5` The definition of `operator_dispatch` makes use of an exposition-only type *string-literal*, which is constructible from a `char` array at compile-time and can be used as a non-type template argument. diff --git a/docs/spec/proxiable.md b/docs/spec/proxiable.md index 169e9404..07bcd4cd 100644 --- a/docs/spec/proxiable.md +++ b/docs/spec/proxiable.md @@ -2,7 +2,7 @@ > Header: `proxy.h` > Module: `proxy` -> Namespace: `pro::inline v4` +> Namespace: `pro::inline v5` ```cpp template diff --git a/docs/spec/proxiable_target.md b/docs/spec/proxiable_target.md index fe46d69b..8582e93b 100644 --- a/docs/spec/proxiable_target.md +++ b/docs/spec/proxiable_target.md @@ -2,7 +2,7 @@ > Header: `proxy.h` > Module: `proxy` -> Namespace: `pro::inline v4` +> Namespace: `pro::inline v5` > Since: 3.3.0 ```cpp diff --git a/docs/spec/proxy/README.md b/docs/spec/proxy/README.md index e7c38d33..484b119f 100644 --- a/docs/spec/proxy/README.md +++ b/docs/spec/proxy/README.md @@ -2,7 +2,7 @@ > Header: `proxy.h` > Module: `proxy` -> Namespace: `pro::inline v4` +> Namespace: `pro::inline v5` ```cpp template diff --git a/docs/spec/proxy_indirect_accessor/README.md b/docs/spec/proxy_indirect_accessor/README.md index 9f2f81ce..cad61382 100644 --- a/docs/spec/proxy_indirect_accessor/README.md +++ b/docs/spec/proxy_indirect_accessor/README.md @@ -2,7 +2,7 @@ > Header: `proxy.h` > Module: `proxy` -> Namespace: `pro::inline v4` +> Namespace: `pro::inline v5` > Since: 3.2.0 ```cpp diff --git a/docs/spec/proxy_invoke.md b/docs/spec/proxy_invoke.md index dd84873a..a7d180fc 100644 --- a/docs/spec/proxy_invoke.md +++ b/docs/spec/proxy_invoke.md @@ -2,7 +2,7 @@ > Header: `proxy.h` > Module: `proxy` -> Namespace: `pro::inline v4` +> Namespace: `pro::inline v5` > **Deprecated since 4.1.0**: Use the non-member `invoke` of [`proxy`](proxy/friend_invoke.md) (for `(2)`) or [`proxy_indirect_accessor`](proxy_indirect_accessor/friend_invoke.md) (for `(1)`) instead. Each overload of `proxy_invoke` is marked `[[deprecated]]` and forwards to the corresponding overload of `invoke`. `proxy_invoke` is retained for backward compatibility and may be removed in a future major release. diff --git a/docs/spec/proxy_reflect.md b/docs/spec/proxy_reflect.md index 2d0fde6f..da9a9a28 100644 --- a/docs/spec/proxy_reflect.md +++ b/docs/spec/proxy_reflect.md @@ -2,7 +2,7 @@ > Header: `proxy.h` > Module: `proxy` -> Namespace: `pro::inline v4` +> Namespace: `pro::inline v5` > **Deprecated since 4.1.0**: Use the non-member `reflect` of [`proxy`](proxy/friend_reflect.md) (for `(2)`) or [`proxy_indirect_accessor`](proxy_indirect_accessor/friend_reflect.md) (for `(1)`) instead. Each overload of `proxy_reflect` is marked `[[deprecated]]` and forwards to the corresponding overload of `reflect`. `proxy_reflect` is retained for backward compatibility and may be removed in a future major release. diff --git a/docs/spec/proxy_view.md b/docs/spec/proxy_view.md index 246bf1c7..6aeb7e24 100644 --- a/docs/spec/proxy_view.md +++ b/docs/spec/proxy_view.md @@ -2,7 +2,7 @@ > Header: `proxy.h` > Module: `proxy` -> Namespace: `pro::inline v4` +> Namespace: `pro::inline v5` > Since: 3.2.0 ```cpp diff --git a/docs/spec/skills_as_view.md b/docs/spec/skills_as_view.md index ffdf5d96..ad06917f 100644 --- a/docs/spec/skills_as_view.md +++ b/docs/spec/skills_as_view.md @@ -2,7 +2,7 @@ > Header: `proxy.h` > Module: `proxy` -> Namespace: `pro::inline v4::skills` +> Namespace: `pro::inline v5::skills` > Since: 4.0.0 ```cpp diff --git a/docs/spec/skills_as_weak.md b/docs/spec/skills_as_weak.md index b3e32262..821dc276 100644 --- a/docs/spec/skills_as_weak.md +++ b/docs/spec/skills_as_weak.md @@ -2,7 +2,7 @@ > Header: `proxy.h` > Module: `proxy` -> Namespace: `pro::inline v4::skills` +> Namespace: `pro::inline v5::skills` > Since: 4.0.0 ```cpp diff --git a/docs/spec/skills_fmt_format.md b/docs/spec/skills_fmt_format.md index 30105cd0..e7ef27a0 100644 --- a/docs/spec/skills_fmt_format.md +++ b/docs/spec/skills_fmt_format.md @@ -2,7 +2,7 @@ > Header: `proxy_fmt.h` > Module: None -> Namespace: `pro::inline v4::skills` +> Namespace: `pro::inline v5::skills` > Since: 4.0.0 ```cpp diff --git a/docs/spec/skills_format.md b/docs/spec/skills_format.md index 42d3689b..fa08ba72 100644 --- a/docs/spec/skills_format.md +++ b/docs/spec/skills_format.md @@ -2,7 +2,7 @@ > Header: `proxy.h` > Module: `proxy` -> Namespace: `pro::inline v4::skills` +> Namespace: `pro::inline v5::skills` > Since: 4.0.0 ```cpp diff --git a/docs/spec/skills_rtti/README.md b/docs/spec/skills_rtti/README.md index 9b4afbd6..b0690ec6 100644 --- a/docs/spec/skills_rtti/README.md +++ b/docs/spec/skills_rtti/README.md @@ -2,7 +2,7 @@ > Header: `proxy.h` > Module: `proxy` -> Namespace: `pro::inline v4::skills` +> Namespace: `pro::inline v5::skills` > Since: 4.0.0 ```cpp diff --git a/docs/spec/skills_slim.md b/docs/spec/skills_slim.md index 90aaaa56..8518cc35 100644 --- a/docs/spec/skills_slim.md +++ b/docs/spec/skills_slim.md @@ -2,7 +2,7 @@ > Header: `proxy.h` > Module: `proxy` -> Namespace: `pro::inline v4::skills` +> Namespace: `pro::inline v5::skills` > Since: 4.0.0 ```cpp diff --git a/docs/spec/weak_dispatch/README.md b/docs/spec/weak_dispatch/README.md index 187a304b..9ec8fc72 100644 --- a/docs/spec/weak_dispatch/README.md +++ b/docs/spec/weak_dispatch/README.md @@ -2,7 +2,7 @@ > Header: `proxy.h` > Module: `proxy` -> Namespace: `pro::inline v4` +> Namespace: `pro::inline v5` > Since: 3.2.0 ```cpp diff --git a/docs/spec/weak_proxy.md b/docs/spec/weak_proxy.md index 578df57e..e8f55722 100644 --- a/docs/spec/weak_proxy.md +++ b/docs/spec/weak_proxy.md @@ -2,7 +2,7 @@ > Header: `proxy.h` > Module: `proxy` -> Namespace: `pro::inline v4` +> Namespace: `pro::inline v5` > Since: 3.3.0 ```cpp diff --git a/include/proxy/proxy.h b/include/proxy/proxy.h index fa2b431b..ed1e4a33 100644 --- a/include/proxy/proxy.h +++ b/include/proxy/proxy.h @@ -5,6 +5,6 @@ #ifndef MSFT_PROXY_PROXY_H_ #define MSFT_PROXY_PROXY_H_ -#include "v4/proxy.h" // IWYU pragma: export +#include "v5/proxy.h" // IWYU pragma: export #endif // MSFT_PROXY_PROXY_H_ diff --git a/include/proxy/proxy_fmt.h b/include/proxy/proxy_fmt.h index 5dbbbcd1..2a56d3fa 100644 --- a/include/proxy/proxy_fmt.h +++ b/include/proxy/proxy_fmt.h @@ -5,6 +5,6 @@ #ifndef MSFT_PROXY_PROXY_FMT_H_ #define MSFT_PROXY_PROXY_FMT_H_ -#include "v4/proxy_fmt.h" // IWYU pragma: export +#include "v5/proxy_fmt.h" // IWYU pragma: export #endif // MSFT_PROXY_PROXY_FMT_H_ diff --git a/include/proxy/proxy_macros.h b/include/proxy/proxy_macros.h index cba1bdf1..1c4c2bf0 100644 --- a/include/proxy/proxy_macros.h +++ b/include/proxy/proxy_macros.h @@ -5,6 +5,6 @@ #ifndef MSFT_PROXY_PROXY_MACROS_H_ #define MSFT_PROXY_PROXY_MACROS_H_ -#include "v4/proxy_macros.h" // IWYU pragma: export +#include "v5/proxy_macros.h" // IWYU pragma: export #endif // MSFT_PROXY_PROXY_MACROS_H_ diff --git a/include/proxy/v4/proxy.ixx b/include/proxy/v4/proxy.ixx deleted file mode 100644 index 19303be9..00000000 --- a/include/proxy/v4/proxy.ixx +++ /dev/null @@ -1,74 +0,0 @@ -module; - -#include - -export module proxy.v4; - -export namespace pro::inline v4 { - -#if __STDC_HOSTED__ -using v4::allocate_proxy; -using v4::allocate_proxy_shared; -using v4::make_proxy; -using v4::make_proxy_shared; -#endif // __STDC_HOSTED__ - -#if __cpp_rtti >= 199711L -using v4::bad_proxy_cast; -#endif // __cpp_rtti >= 199711L - -using v4::basic_facade_builder; -using v4::constraint_level; -using v4::conversion_dispatch; -using v4::explicit_conversion_dispatch; -using v4::facade; -using v4::facade_aware_overload_t; -using v4::facade_builder; -using v4::implicit_conversion_dispatch; -using v4::inplace_proxiable_target; -using v4::is_bitwise_trivially_relocatable; -using v4::is_bitwise_trivially_relocatable_v; -using v4::make_proxy_inplace; -using v4::make_proxy_view; -using v4::not_implemented; -using v4::observer_facade; -using v4::operator_dispatch; -using v4::proxiable; -using v4::proxiable_target; -using v4::proxy; -using v4::proxy_indirect_accessor; -using v4::proxy_invoke; -using v4::proxy_reflect; -using v4::proxy_view; -using v4::weak_dispatch; -using v4::weak_facade; -using v4::weak_proxy; - -namespace skills { - -#ifdef PRO4D_HAS_FORMAT -using skills::format; -using skills::wformat; -#endif // PRO4D_HAS_FORMAT - -#if __cpp_rtti >= 199711L -using skills::direct_rtti; -using skills::indirect_rtti; -using skills::rtti; -#endif // __cpp_rtti >= 199711L - -using skills::as_view; -using skills::as_weak; -using skills::slim; - -} // namespace skills - -} // namespace pro::inline v4 - -#ifdef PRO4D_HAS_FORMAT -export namespace std { - -using std::formatter; - -} // namespace std -#endif // PRO4D_HAS_FORMAT diff --git a/include/proxy/v4/detail/compatibility_check.h b/include/proxy/v5/detail/compatibility_check.h similarity index 79% rename from include/proxy/v4/detail/compatibility_check.h rename to include/proxy/v5/detail/compatibility_check.h index 1740b3ae..ea594691 100644 --- a/include/proxy/v4/detail/compatibility_check.h +++ b/include/proxy/v5/detail/compatibility_check.h @@ -2,8 +2,8 @@ // Copyright (c) 2026-Present Next Gen C++ Foundation. // Licensed under the MIT License. -#ifndef MSFT_PROXY_V4_DETAIL_COMPATIBILITY_CHECK_H_ -#define MSFT_PROXY_V4_DETAIL_COMPATIBILITY_CHECK_H_ +#ifndef MSFT_PROXY_V5_DETAIL_COMPATIBILITY_CHECK_H_ +#define MSFT_PROXY_V5_DETAIL_COMPATIBILITY_CHECK_H_ #if (defined(_MSVC_LANG) ? _MSVC_LANG : __cplusplus) < 202002L #error "Proxy requires C++20 or later." @@ -12,7 +12,7 @@ // clang-cl miscalculates the layout of an empty [[msvc::no_unique_address]] // member in a base class (llvm/llvm-project#143245), corrupting pro::proxy. #if __has_cpp_attribute(msvc::no_unique_address) -namespace pro::inline v4::detail::compatibility_check { +namespace pro::inline v5::detail::compatibility_check { struct empty {}; struct base { [[msvc::no_unique_address]] empty value; @@ -22,7 +22,7 @@ struct derived : base { }; static_assert(sizeof(derived) == sizeof(char), "[[msvc::no_unique_address]] is broken"); -} // namespace pro::inline v4::detail::compatibility_check +} // namespace pro::inline v5::detail::compatibility_check #endif #ifdef __has_feature @@ -33,4 +33,4 @@ static_assert(sizeof(derived) == sizeof(char), // !__has_include()) #endif // __has_feature -#endif // MSFT_PROXY_V4_DETAIL_COMPATIBILITY_CHECK_H_ +#endif // MSFT_PROXY_V5_DETAIL_COMPATIBILITY_CHECK_H_ diff --git a/include/proxy/v4/detail/core.h b/include/proxy/v5/detail/core.h similarity index 97% rename from include/proxy/v4/detail/core.h rename to include/proxy/v5/detail/core.h index 9074aaf5..0a25174a 100644 --- a/include/proxy/v4/detail/core.h +++ b/include/proxy/v5/detail/core.h @@ -2,8 +2,8 @@ // Copyright (c) 2026-Present Next Gen C++ Foundation. // Licensed under the MIT License. -#ifndef MSFT_PROXY_V4_DETAIL_CORE_H_ -#define MSFT_PROXY_V4_DETAIL_CORE_H_ +#ifndef MSFT_PROXY_V5_DETAIL_CORE_H_ +#define MSFT_PROXY_V5_DETAIL_CORE_H_ #include #include @@ -20,20 +20,20 @@ #include "./facade_meta_traits.h" #if __has_cpp_attribute(msvc::no_unique_address) -#define PRO4D_NO_UNIQUE_ADDRESS_ATTRIBUTE msvc::no_unique_address +#define PRO5D_NO_UNIQUE_ADDRESS_ATTRIBUTE msvc::no_unique_address #elif __has_cpp_attribute(no_unique_address) -#define PRO4D_NO_UNIQUE_ADDRESS_ATTRIBUTE no_unique_address +#define PRO5D_NO_UNIQUE_ADDRESS_ATTRIBUTE no_unique_address #else #error Proxy requires C++20 attribute no_unique_address. #endif // __has_cpp_attribute(msvc::no_unique_address) #if __cpp_lib_unreachable >= 202202L -#define PRO4D_UNREACHABLE() std::unreachable() +#define PRO5D_UNREACHABLE() std::unreachable() #else -#define PRO4D_UNREACHABLE() std::abort() +#define PRO5D_UNREACHABLE() std::abort() #endif // __cpp_lib_unreachable >= 202202L -namespace pro::inline v4 { +namespace pro::inline v5 { namespace detail { @@ -57,7 +57,7 @@ concept facade = detail::basic_facade_traits::applicable; template class proxy_indirect_accessor; template -class PRO4D_ENFORCE_EBO proxy; +class PRO5D_ENFORCE_EBO proxy; template struct is_bitwise_trivially_relocatable @@ -509,7 +509,7 @@ struct reflection_meta { std::in_place_type::element_type>) { } - [[PRO4D_NO_UNIQUE_ADDRESS_ATTRIBUTE]] + [[PRO5D_NO_UNIQUE_ADDRESS_ATTRIBUTE]] R reflector; }; @@ -527,13 +527,13 @@ consteval bool is_reflector_well_formed() { } struct copy_dispatch { template - PRO4D_STATIC_CALL(void, const T& self, void* rhs) noexcept( + PRO5D_STATIC_CALL(void, const T& self, void* rhs) noexcept( std::is_nothrow_copy_constructible_v) { std::construct_at(static_cast(rhs), self); } }; struct destroy_dispatch { - PRO4D_STATIC_CALL(void, auto&&) noexcept {} + PRO5D_STATIC_CALL(void, auto&&) noexcept {} }; template struct lifetime_meta_traits : std::type_identity {}; @@ -547,7 +547,7 @@ template using lifetime_meta_t = lifetime_meta_traits::type; template -struct PRO4D_ENFORCE_EBO composite_accessor : As... {}; +struct PRO5D_ENFORCE_EBO composite_accessor : As... {}; template using refl_accessors_t = @@ -647,7 +647,7 @@ struct sentinel_meta { }; template -struct PRO4D_ENFORCE_EBO composite_meta : Ms... { +struct PRO5D_ENFORCE_EBO composite_meta : Ms... { composite_meta() = default; template constexpr explicit composite_meta(std::in_place_type_t

) @@ -977,7 +977,7 @@ struct facade_traits template [[noreturn]] static consteval void diagnose_proxiable_noreturn() { diagnose_proxiable

(); - PRO4D_UNREACHABLE(); // Propagate the error to the caller side + PRO5D_UNREACHABLE(); // Propagate the error to the caller side } template @@ -1017,7 +1017,7 @@ class inplace_ptr { const T&& operator*() const&& noexcept { return std::move(value_); } private: - [[PRO4D_NO_UNIQUE_ADDRESS_ATTRIBUTE]] + [[PRO5D_NO_UNIQUE_ADDRESS_ATTRIBUTE]] T value_; }; @@ -1390,12 +1390,12 @@ class proxy : public detail::facade_traits::direct_accessor, private: void initialize() { - PRO4D_DEBUG(std::ignore = &pro_symbol_guard;) + PRO5D_DEBUG(std::ignore = &pro_symbol_guard;) meta_.reset(); } template void initialize(const proxy& rhs) { - PRO4D_DEBUG(std::ignore = &pro_symbol_guard;) + PRO5D_DEBUG(std::ignore = &pro_symbol_guard;) if (rhs.has_value()) { if constexpr (F2::copyability == constraint_level::trivial) { std::uninitialized_copy_n(rhs.ptr_, F2::max_size, ptr_); @@ -1411,7 +1411,7 @@ class proxy : public detail::facade_traits::direct_accessor, } template void initialize(proxy&& rhs) { - PRO4D_DEBUG(std::ignore = &pro_symbol_guard;) + PRO5D_DEBUG(std::ignore = &pro_symbol_guard;) if (rhs.has_value()) { auto meta = rhs.meta_; if constexpr (F2::relocatability == constraint_level::trivial) { @@ -1430,7 +1430,7 @@ class proxy : public detail::facade_traits::direct_accessor, } template constexpr P& initialize(Args&&... args) { - PRO4D_DEBUG(std::ignore = &pro_symbol_guard;) + PRO5D_DEBUG(std::ignore = &pro_symbol_guard;) P& result = *std::construct_at(reinterpret_cast(ptr_), std::forward(args)...); if constexpr (proxiable) { @@ -1451,7 +1451,7 @@ class proxy : public detail::facade_traits::direct_accessor, } } } - PRO4D_DEBUG(static inline void pro_symbol_guard(proxy& self, + PRO5D_DEBUG(static inline void pro_symbol_guard(proxy& self, const proxy& cself) { self.operator->(); *self; @@ -1562,10 +1562,10 @@ struct converter { F f_; }; -#define PRO4D_DEF_CAST_ACCESSOR(oq, pq, ne, ...) \ +#define PRO5D_DEF_CAST_ACCESSOR(oq, pq, ne, ...) \ template \ struct accessor { \ - PRO4D_GEN_DEBUG_SYMBOL_FOR_MEM_ACCESSOR(operator T) \ + PRO5D_GEN_DEBUG_SYMBOL_FOR_MEM_ACCESSOR(operator T) \ explicit(Expl) operator T() oq ne { \ if constexpr (Nullable) { \ if (!static_cast(*this).has_value()) { \ @@ -1577,11 +1577,11 @@ struct converter { } template struct cast_dispatch_base { - PRO4D_DEF_ACCESSOR_TEMPLATE( - MEM, PRO4D_DEF_CAST_ACCESSOR, + PRO5D_DEF_ACCESSOR_TEMPLATE( + MEM, PRO5D_DEF_CAST_ACCESSOR, operator typename overload_traits::return_type) }; -#undef PRO4D_DEF_CAST_ACCESSOR +#undef PRO5D_DEF_CAST_ACCESSOR template struct conv_impl { @@ -1656,7 +1656,7 @@ auto weak_lock_impl(const P& self) noexcept return self.lock(); } } -PRO4_DEF_FREE_AS_MEM_DISPATCH(weak_mem_lock, weak_lock_impl, lock); +PRO5_DEF_FREE_AS_MEM_DISPATCH(weak_mem_lock, weak_lock_impl, lock); template using weak_lock_overload = proxy() const noexcept; @@ -1690,6 +1690,6 @@ struct weak_facade using strong_type = F; }; -} // namespace pro::inline v4 +} // namespace pro::inline v5 -#endif // MSFT_PROXY_V4_DETAIL_CORE_H_ +#endif // MSFT_PROXY_V5_DETAIL_CORE_H_ diff --git a/include/proxy/v4/detail/dispatch.h b/include/proxy/v5/detail/dispatch.h similarity index 59% rename from include/proxy/v4/detail/dispatch.h rename to include/proxy/v5/detail/dispatch.h index 9c25dc6d..98dc5c3b 100644 --- a/include/proxy/v4/detail/dispatch.h +++ b/include/proxy/v5/detail/dispatch.h @@ -2,14 +2,14 @@ // Copyright (c) 2026-Present Next Gen C++ Foundation. // Licensed under the MIT License. -#ifndef MSFT_PROXY_V4_DETAIL_DISPATCH_H_ -#define MSFT_PROXY_V4_DETAIL_DISPATCH_H_ +#ifndef MSFT_PROXY_V5_DETAIL_DISPATCH_H_ +#define MSFT_PROXY_V5_DETAIL_DISPATCH_H_ #include #include "core.h" -namespace pro::inline v4 { +namespace pro::inline v5 { namespace detail { @@ -17,7 +17,7 @@ template struct sign { consteval sign(const char (&str)[N + 1]) { if (str[N] != '\0') { - PRO4D_UNREACHABLE(); + PRO5D_UNREACHABLE(); } for (std::size_t i = 0; i < N; ++i) { value[i] = str[i]; @@ -47,8 +47,8 @@ concept explicitly_convertible = struct noreturn_conversion { template - [[noreturn]] PRO4D_STATIC_CALL(T, std::in_place_type_t) { - PRO4D_UNREACHABLE(); + [[noreturn]] PRO5D_STATIC_CALL(T, std::in_place_type_t) { + PRO5D_UNREACHABLE(); } }; using wildcard = converter; @@ -58,18 +58,18 @@ using wildcard = converter; template struct operator_dispatch; -#define PRO4D_DEF_LHS_LEFT_OP_ACCESSOR(oq, pq, ne, ...) \ +#define PRO5D_DEF_LHS_LEFT_OP_ACCESSOR(oq, pq, ne, ...) \ template \ struct accessor { \ - PRO4D_GEN_DEBUG_SYMBOL_FOR_MEM_ACCESSOR(__VA_ARGS__) \ + PRO5D_GEN_DEBUG_SYMBOL_FOR_MEM_ACCESSOR(__VA_ARGS__) \ R __VA_ARGS__() oq ne { \ return invoke(static_cast

(*this)); \ } \ } -#define PRO4D_DEF_LHS_UNARY_OP_ACCESSOR(oq, pq, ne, ...) \ +#define PRO5D_DEF_LHS_UNARY_OP_ACCESSOR(oq, pq, ne, ...) \ template \ struct accessor { \ - PRO4D_GEN_DEBUG_SYMBOL_FOR_MEM_ACCESSOR(__VA_ARGS__) \ + PRO5D_GEN_DEBUG_SYMBOL_FOR_MEM_ACCESSOR(__VA_ARGS__) \ decltype(auto) __VA_ARGS__() oq ne { \ invoke(static_cast

(*this)); \ return static_cast

(*this); \ @@ -77,47 +77,47 @@ struct operator_dispatch; }; \ template \ struct accessor { \ - PRO4D_GEN_DEBUG_SYMBOL_FOR_MEM_ACCESSOR(__VA_ARGS__) \ + PRO5D_GEN_DEBUG_SYMBOL_FOR_MEM_ACCESSOR(__VA_ARGS__) \ R __VA_ARGS__(int) oq ne { \ return invoke(static_cast

(*this), 0); \ } \ } -#define PRO4D_DEF_LHS_BINARY_OP_ACCESSOR PRO4D_DEF_MEM_ACCESSOR -#define PRO4D_DEF_LHS_ALL_OP_ACCESSOR PRO4D_DEF_MEM_ACCESSOR -#define PRO4D_LHS_LEFT_OP_DISPATCH_BODY_IMPL(...) \ +#define PRO5D_DEF_LHS_BINARY_OP_ACCESSOR PRO5D_DEF_MEM_ACCESSOR +#define PRO5D_DEF_LHS_ALL_OP_ACCESSOR PRO5D_DEF_MEM_ACCESSOR +#define PRO5D_LHS_LEFT_OP_DISPATCH_BODY_IMPL(...) \ template \ - PRO4D_STATIC_CALL(decltype(auto), T&& self) \ - PRO4D_DIRECT_FUNC_IMPL(__VA_ARGS__ std::forward(self)) -#define PRO4D_LHS_UNARY_OP_DISPATCH_BODY_IMPL(...) \ + PRO5D_STATIC_CALL(decltype(auto), T&& self) \ + PRO5D_DIRECT_FUNC_IMPL(__VA_ARGS__ std::forward(self)) +#define PRO5D_LHS_UNARY_OP_DISPATCH_BODY_IMPL(...) \ template \ - PRO4D_STATIC_CALL(decltype(auto), T&& self) \ - PRO4D_DIRECT_FUNC_IMPL(__VA_ARGS__ std::forward(self)) template \ - PRO4D_STATIC_CALL(decltype(auto), T&& self, int) \ - PRO4D_DIRECT_FUNC_IMPL(std::forward(self) __VA_ARGS__) -#define PRO4D_LHS_BINARY_OP_DISPATCH_BODY_IMPL(...) \ + PRO5D_STATIC_CALL(decltype(auto), T&& self) \ + PRO5D_DIRECT_FUNC_IMPL(__VA_ARGS__ std::forward(self)) template \ + PRO5D_STATIC_CALL(decltype(auto), T&& self, int) \ + PRO5D_DIRECT_FUNC_IMPL(std::forward(self) __VA_ARGS__) +#define PRO5D_LHS_BINARY_OP_DISPATCH_BODY_IMPL(...) \ template \ - PRO4D_STATIC_CALL(decltype(auto), T&& self, Arg&& arg) \ - PRO4D_DIRECT_FUNC_IMPL(std::forward(self) \ + PRO5D_STATIC_CALL(decltype(auto), T&& self, Arg&& arg) \ + PRO5D_DIRECT_FUNC_IMPL(std::forward(self) \ __VA_ARGS__ std::forward(arg)) -#define PRO4D_LHS_ALL_OP_DISPATCH_BODY_IMPL(...) \ - PRO4D_LHS_LEFT_OP_DISPATCH_BODY_IMPL(__VA_ARGS__) \ - PRO4D_LHS_BINARY_OP_DISPATCH_BODY_IMPL(__VA_ARGS__) -#define PRO4D_LHS_OP_DISPATCH_IMPL(type, ...) \ +#define PRO5D_LHS_ALL_OP_DISPATCH_BODY_IMPL(...) \ + PRO5D_LHS_LEFT_OP_DISPATCH_BODY_IMPL(__VA_ARGS__) \ + PRO5D_LHS_BINARY_OP_DISPATCH_BODY_IMPL(__VA_ARGS__) +#define PRO5D_LHS_OP_DISPATCH_IMPL(type, ...) \ template <> \ struct operator_dispatch<#__VA_ARGS__, false> { \ - PRO4D_LHS_##type##_OP_DISPATCH_BODY_IMPL(__VA_ARGS__) \ - PRO4D_DEF_ACCESSOR_TEMPLATE( \ - MEM, PRO4D_DEF_LHS_##type##_OP_ACCESSOR, operator __VA_ARGS__) \ + PRO5D_LHS_##type##_OP_DISPATCH_BODY_IMPL(__VA_ARGS__) \ + PRO5D_DEF_ACCESSOR_TEMPLATE( \ + MEM, PRO5D_DEF_LHS_##type##_OP_ACCESSOR, operator __VA_ARGS__) \ }; -#define PRO4D_DEF_RHS_OP_ACCESSOR(oq, pq, ne, ...) \ +#define PRO5D_DEF_RHS_OP_ACCESSOR(oq, pq, ne, ...) \ template \ struct accessor { \ friend R operator __VA_ARGS__(Arg arg, P pq self) ne { \ return invoke(static_cast

(self), \ std::forward(arg)); \ } \ - PRO4D_DEBUG( \ + PRO5D_DEBUG( \ accessor() noexcept { std::ignore = &pro_symbol_guard; } \ \ private: \ @@ -126,153 +126,153 @@ struct operator_dispatch; } \ ) \ } -#define PRO4D_RHS_OP_DISPATCH_IMPL(...) \ +#define PRO5D_RHS_OP_DISPATCH_IMPL(...) \ template <> \ struct operator_dispatch<#__VA_ARGS__, true> { \ template \ - PRO4D_STATIC_CALL(decltype(auto), T&& self, Arg&& arg) \ - PRO4D_DIRECT_FUNC_IMPL(std::forward(arg) \ + PRO5D_STATIC_CALL(decltype(auto), T&& self, Arg&& arg) \ + PRO5D_DIRECT_FUNC_IMPL(std::forward(arg) \ __VA_ARGS__ std::forward(self)) \ - PRO4D_DEF_ACCESSOR_TEMPLATE(FREE, PRO4D_DEF_RHS_OP_ACCESSOR, \ + PRO5D_DEF_ACCESSOR_TEMPLATE(FREE, PRO5D_DEF_RHS_OP_ACCESSOR, \ __VA_ARGS__) \ }; -#define PRO4D_EXTENDED_BINARY_OP_DISPATCH_IMPL(...) \ - PRO4D_LHS_OP_DISPATCH_IMPL(ALL, __VA_ARGS__) \ - PRO4D_RHS_OP_DISPATCH_IMPL(__VA_ARGS__) +#define PRO5D_EXTENDED_BINARY_OP_DISPATCH_IMPL(...) \ + PRO5D_LHS_OP_DISPATCH_IMPL(ALL, __VA_ARGS__) \ + PRO5D_RHS_OP_DISPATCH_IMPL(__VA_ARGS__) -#define PRO4D_BINARY_OP_DISPATCH_IMPL(...) \ - PRO4D_LHS_OP_DISPATCH_IMPL(BINARY, __VA_ARGS__) \ - PRO4D_RHS_OP_DISPATCH_IMPL(__VA_ARGS__) +#define PRO5D_BINARY_OP_DISPATCH_IMPL(...) \ + PRO5D_LHS_OP_DISPATCH_IMPL(BINARY, __VA_ARGS__) \ + PRO5D_RHS_OP_DISPATCH_IMPL(__VA_ARGS__) -#define PRO4D_DEF_LHS_ASSIGNMENT_OP_ACCESSOR(oq, pq, ne, ...) \ +#define PRO5D_DEF_LHS_ASSIGNMENT_OP_ACCESSOR(oq, pq, ne, ...) \ template \ struct accessor { \ - PRO4D_GEN_DEBUG_SYMBOL_FOR_MEM_ACCESSOR(__VA_ARGS__) \ + PRO5D_GEN_DEBUG_SYMBOL_FOR_MEM_ACCESSOR(__VA_ARGS__) \ decltype(auto) __VA_ARGS__(Arg arg) oq ne { \ invoke(static_cast

(*this), \ std::forward(arg)); \ return static_cast

(*this); \ } \ } -#define PRO4D_DEF_RHS_ASSIGNMENT_OP_ACCESSOR(oq, pq, ne, ...) \ +#define PRO5D_DEF_RHS_ASSIGNMENT_OP_ACCESSOR(oq, pq, ne, ...) \ template \ struct accessor { \ friend Arg& operator __VA_ARGS__(Arg& arg, P pq self) ne { \ invoke(static_cast

(self), arg); \ return arg; \ } \ - PRO4D_DEBUG( \ + PRO5D_DEBUG( \ accessor() noexcept { std::ignore = &pro_symbol_guard; } \ \ private : static inline Arg& pro_symbol_guard( \ Arg& arg, \ P pq self) { return arg __VA_ARGS__ static_cast

(self); }) \ } -#define PRO4D_ASSIGNMENT_OP_DISPATCH_IMPL(...) \ +#define PRO5D_ASSIGNMENT_OP_DISPATCH_IMPL(...) \ template <> \ struct operator_dispatch<#__VA_ARGS__, false> { \ template \ - PRO4D_STATIC_CALL(decltype(auto), T&& self, Arg&& arg) \ - PRO4D_DIRECT_FUNC_IMPL(std::forward(self) \ + PRO5D_STATIC_CALL(decltype(auto), T&& self, Arg&& arg) \ + PRO5D_DIRECT_FUNC_IMPL(std::forward(self) \ __VA_ARGS__ std::forward(arg)) \ - PRO4D_DEF_ACCESSOR_TEMPLATE( \ - MEM, PRO4D_DEF_LHS_ASSIGNMENT_OP_ACCESSOR, operator __VA_ARGS__) \ + PRO5D_DEF_ACCESSOR_TEMPLATE( \ + MEM, PRO5D_DEF_LHS_ASSIGNMENT_OP_ACCESSOR, operator __VA_ARGS__) \ }; \ template <> \ struct operator_dispatch<#__VA_ARGS__, true> { \ template \ - PRO4D_STATIC_CALL(decltype(auto), T&& self, Arg&& arg) \ - PRO4D_DIRECT_FUNC_IMPL(std::forward(arg) \ + PRO5D_STATIC_CALL(decltype(auto), T&& self, Arg&& arg) \ + PRO5D_DIRECT_FUNC_IMPL(std::forward(arg) \ __VA_ARGS__ std::forward(self)) \ - PRO4D_DEF_ACCESSOR_TEMPLATE(FREE, \ - PRO4D_DEF_RHS_ASSIGNMENT_OP_ACCESSOR, \ + PRO5D_DEF_ACCESSOR_TEMPLATE(FREE, \ + PRO5D_DEF_RHS_ASSIGNMENT_OP_ACCESSOR, \ __VA_ARGS__) \ }; -PRO4D_EXTENDED_BINARY_OP_DISPATCH_IMPL(+) -PRO4D_EXTENDED_BINARY_OP_DISPATCH_IMPL(-) -PRO4D_EXTENDED_BINARY_OP_DISPATCH_IMPL(*) -PRO4D_BINARY_OP_DISPATCH_IMPL(/) -PRO4D_BINARY_OP_DISPATCH_IMPL(%) -PRO4D_LHS_OP_DISPATCH_IMPL(UNARY, ++) -PRO4D_LHS_OP_DISPATCH_IMPL(UNARY, --) -PRO4D_BINARY_OP_DISPATCH_IMPL(==) -PRO4D_BINARY_OP_DISPATCH_IMPL(!=) -PRO4D_BINARY_OP_DISPATCH_IMPL(>) -PRO4D_BINARY_OP_DISPATCH_IMPL(<) -PRO4D_BINARY_OP_DISPATCH_IMPL(>=) -PRO4D_BINARY_OP_DISPATCH_IMPL(<=) -PRO4D_BINARY_OP_DISPATCH_IMPL(<=>) -PRO4D_LHS_OP_DISPATCH_IMPL(LEFT, !) -PRO4D_BINARY_OP_DISPATCH_IMPL(&&) -PRO4D_BINARY_OP_DISPATCH_IMPL(||) -PRO4D_LHS_OP_DISPATCH_IMPL(LEFT, ~) -PRO4D_EXTENDED_BINARY_OP_DISPATCH_IMPL(&) -PRO4D_BINARY_OP_DISPATCH_IMPL(|) -PRO4D_BINARY_OP_DISPATCH_IMPL(^) -PRO4D_BINARY_OP_DISPATCH_IMPL(<<) -PRO4D_BINARY_OP_DISPATCH_IMPL(>>) -PRO4D_ASSIGNMENT_OP_DISPATCH_IMPL(+=) -PRO4D_ASSIGNMENT_OP_DISPATCH_IMPL(-=) -PRO4D_ASSIGNMENT_OP_DISPATCH_IMPL(*=) -PRO4D_ASSIGNMENT_OP_DISPATCH_IMPL(/=) -PRO4D_ASSIGNMENT_OP_DISPATCH_IMPL(%=) -PRO4D_ASSIGNMENT_OP_DISPATCH_IMPL(&=) -PRO4D_ASSIGNMENT_OP_DISPATCH_IMPL(|=) -PRO4D_ASSIGNMENT_OP_DISPATCH_IMPL(^=) -PRO4D_ASSIGNMENT_OP_DISPATCH_IMPL(<<=) -PRO4D_ASSIGNMENT_OP_DISPATCH_IMPL(>>=) -PRO4D_BINARY_OP_DISPATCH_IMPL(, ) -PRO4D_BINARY_OP_DISPATCH_IMPL(->*) +PRO5D_EXTENDED_BINARY_OP_DISPATCH_IMPL(+) +PRO5D_EXTENDED_BINARY_OP_DISPATCH_IMPL(-) +PRO5D_EXTENDED_BINARY_OP_DISPATCH_IMPL(*) +PRO5D_BINARY_OP_DISPATCH_IMPL(/) +PRO5D_BINARY_OP_DISPATCH_IMPL(%) +PRO5D_LHS_OP_DISPATCH_IMPL(UNARY, ++) +PRO5D_LHS_OP_DISPATCH_IMPL(UNARY, --) +PRO5D_BINARY_OP_DISPATCH_IMPL(==) +PRO5D_BINARY_OP_DISPATCH_IMPL(!=) +PRO5D_BINARY_OP_DISPATCH_IMPL(>) +PRO5D_BINARY_OP_DISPATCH_IMPL(<) +PRO5D_BINARY_OP_DISPATCH_IMPL(>=) +PRO5D_BINARY_OP_DISPATCH_IMPL(<=) +PRO5D_BINARY_OP_DISPATCH_IMPL(<=>) +PRO5D_LHS_OP_DISPATCH_IMPL(LEFT, !) +PRO5D_BINARY_OP_DISPATCH_IMPL(&&) +PRO5D_BINARY_OP_DISPATCH_IMPL(||) +PRO5D_LHS_OP_DISPATCH_IMPL(LEFT, ~) +PRO5D_EXTENDED_BINARY_OP_DISPATCH_IMPL(&) +PRO5D_BINARY_OP_DISPATCH_IMPL(|) +PRO5D_BINARY_OP_DISPATCH_IMPL(^) +PRO5D_BINARY_OP_DISPATCH_IMPL(<<) +PRO5D_BINARY_OP_DISPATCH_IMPL(>>) +PRO5D_ASSIGNMENT_OP_DISPATCH_IMPL(+=) +PRO5D_ASSIGNMENT_OP_DISPATCH_IMPL(-=) +PRO5D_ASSIGNMENT_OP_DISPATCH_IMPL(*=) +PRO5D_ASSIGNMENT_OP_DISPATCH_IMPL(/=) +PRO5D_ASSIGNMENT_OP_DISPATCH_IMPL(%=) +PRO5D_ASSIGNMENT_OP_DISPATCH_IMPL(&=) +PRO5D_ASSIGNMENT_OP_DISPATCH_IMPL(|=) +PRO5D_ASSIGNMENT_OP_DISPATCH_IMPL(^=) +PRO5D_ASSIGNMENT_OP_DISPATCH_IMPL(<<=) +PRO5D_ASSIGNMENT_OP_DISPATCH_IMPL(>>=) +PRO5D_BINARY_OP_DISPATCH_IMPL(, ) +PRO5D_BINARY_OP_DISPATCH_IMPL(->*) template <> struct operator_dispatch<"()", false> { template - PRO4D_STATIC_CALL(decltype(auto), T&& self, Args&&... args) - PRO4D_DIRECT_FUNC_IMPL(std::forward(self)(std::forward(args)...)) - PRO4D_DEF_ACCESSOR_TEMPLATE(MEM, PRO4D_DEF_MEM_ACCESSOR, operator()) + PRO5D_STATIC_CALL(decltype(auto), T&& self, Args&&... args) + PRO5D_DIRECT_FUNC_IMPL(std::forward(self)(std::forward(args)...)) + PRO5D_DEF_ACCESSOR_TEMPLATE(MEM, PRO5D_DEF_MEM_ACCESSOR, operator()) }; template <> struct operator_dispatch<"[]", false> { #if __cpp_multidimensional_subscript >= 202110L template - PRO4D_STATIC_CALL(decltype(auto), T&& self, Args&&... args) - PRO4D_DIRECT_FUNC_IMPL(std::forward(self)[std::forward(args)...]) + PRO5D_STATIC_CALL(decltype(auto), T&& self, Args&&... args) + PRO5D_DIRECT_FUNC_IMPL(std::forward(self)[std::forward(args)...]) #else template - PRO4D_STATIC_CALL(decltype(auto), T&& self, Arg&& arg) - PRO4D_DIRECT_FUNC_IMPL(std::forward(self)[std::forward(arg)]) + PRO5D_STATIC_CALL(decltype(auto), T&& self, Arg&& arg) + PRO5D_DIRECT_FUNC_IMPL(std::forward(self)[std::forward(arg)]) #endif // __cpp_multidimensional_subscript >= 202110L - PRO4D_DEF_ACCESSOR_TEMPLATE(MEM, PRO4D_DEF_MEM_ACCESSOR, operator[]) + PRO5D_DEF_ACCESSOR_TEMPLATE(MEM, PRO5D_DEF_MEM_ACCESSOR, operator[]) }; -#undef PRO4D_ASSIGNMENT_OP_DISPATCH_IMPL -#undef PRO4D_DEF_RHS_ASSIGNMENT_OP_ACCESSOR -#undef PRO4D_DEF_LHS_ASSIGNMENT_OP_ACCESSOR -#undef PRO4D_BINARY_OP_DISPATCH_IMPL -#undef PRO4D_EXTENDED_BINARY_OP_DISPATCH_IMPL -#undef PRO4D_RHS_OP_DISPATCH_IMPL -#undef PRO4D_DEF_RHS_OP_ACCESSOR -#undef PRO4D_LHS_OP_DISPATCH_IMPL -#undef PRO4D_LHS_ALL_OP_DISPATCH_BODY_IMPL -#undef PRO4D_LHS_BINARY_OP_DISPATCH_BODY_IMPL -#undef PRO4D_LHS_UNARY_OP_DISPATCH_BODY_IMPL -#undef PRO4D_LHS_LEFT_OP_DISPATCH_BODY_IMPL -#undef PRO4D_DEF_LHS_ALL_OP_ACCESSOR -#undef PRO4D_DEF_LHS_BINARY_OP_ACCESSOR -#undef PRO4D_DEF_LHS_UNARY_OP_ACCESSOR -#undef PRO4D_DEF_LHS_LEFT_OP_ACCESSOR +#undef PRO5D_ASSIGNMENT_OP_DISPATCH_IMPL +#undef PRO5D_DEF_RHS_ASSIGNMENT_OP_ACCESSOR +#undef PRO5D_DEF_LHS_ASSIGNMENT_OP_ACCESSOR +#undef PRO5D_BINARY_OP_DISPATCH_IMPL +#undef PRO5D_EXTENDED_BINARY_OP_DISPATCH_IMPL +#undef PRO5D_RHS_OP_DISPATCH_IMPL +#undef PRO5D_DEF_RHS_OP_ACCESSOR +#undef PRO5D_LHS_OP_DISPATCH_IMPL +#undef PRO5D_LHS_ALL_OP_DISPATCH_BODY_IMPL +#undef PRO5D_LHS_BINARY_OP_DISPATCH_BODY_IMPL +#undef PRO5D_LHS_UNARY_OP_DISPATCH_BODY_IMPL +#undef PRO5D_LHS_LEFT_OP_DISPATCH_BODY_IMPL +#undef PRO5D_DEF_LHS_ALL_OP_ACCESSOR +#undef PRO5D_DEF_LHS_BINARY_OP_ACCESSOR +#undef PRO5D_DEF_LHS_UNARY_OP_ACCESSOR +#undef PRO5D_DEF_LHS_LEFT_OP_ACCESSOR struct implicit_conversion_dispatch : detail::cast_dispatch_base { template - PRO4D_STATIC_CALL(T&&, T&& self) noexcept { + PRO5D_STATIC_CALL(T&&, T&& self) noexcept { return std::forward(self); } }; struct explicit_conversion_dispatch : detail::cast_dispatch_base { template - PRO4D_STATIC_CALL(auto, T&& self) noexcept { + PRO5D_STATIC_CALL(auto, T&& self) noexcept { return detail::converter{ [&self](std::in_place_type_t) noexcept( std::is_nothrow_constructible_v) -> U @@ -285,7 +285,7 @@ using conversion_dispatch = explicit_conversion_dispatch; class not_implemented : public std::exception { public: char const* what() const noexcept override { - return "pro::v4::not_implemented"; + return "pro::v5::not_implemented"; } }; @@ -293,13 +293,13 @@ template struct weak_dispatch : D { using D::operator(); template - [[noreturn]] PRO4D_STATIC_CALL(detail::wildcard, Args&&...) + [[noreturn]] PRO5D_STATIC_CALL(detail::wildcard, Args&&...) requires(!std::is_invocable_v) { - PRO4D_THROW(not_implemented{}); + PRO5D_THROW(not_implemented{}); } }; -} // namespace pro::inline v4 +} // namespace pro::inline v5 -#endif // MSFT_PROXY_V4_DETAIL_DISPATCH_H_ +#endif // MSFT_PROXY_V5_DETAIL_DISPATCH_H_ diff --git a/include/proxy/v4/detail/facade_creation.h b/include/proxy/v5/detail/facade_creation.h similarity index 96% rename from include/proxy/v4/detail/facade_creation.h rename to include/proxy/v5/detail/facade_creation.h index 69ce9259..5600a07c 100644 --- a/include/proxy/v4/detail/facade_creation.h +++ b/include/proxy/v5/detail/facade_creation.h @@ -2,14 +2,14 @@ // Copyright (c) 2026-Present Next Gen C++ Foundation. // Licensed under the MIT License. -#ifndef MSFT_PROXY_V4_DETAIL_FACADE_CREATION_H_ -#define MSFT_PROXY_V4_DETAIL_FACADE_CREATION_H_ +#ifndef MSFT_PROXY_V5_DETAIL_FACADE_CREATION_H_ +#define MSFT_PROXY_V5_DETAIL_FACADE_CREATION_H_ #include #include "core.h" -namespace pro::inline v4 { +namespace pro::inline v5 { namespace detail { @@ -115,6 +115,6 @@ using facade_builder = detail::invalid_cl, detail::invalid_cl, detail::invalid_cl>; -} // namespace pro::inline v4 +} // namespace pro::inline v5 -#endif // MSFT_PROXY_V4_DETAIL_FACADE_CREATION_H_ +#endif // MSFT_PROXY_V5_DETAIL_FACADE_CREATION_H_ diff --git a/include/proxy/v4/detail/facade_meta_traits.h b/include/proxy/v5/detail/facade_meta_traits.h similarity index 93% rename from include/proxy/v4/detail/facade_meta_traits.h rename to include/proxy/v5/detail/facade_meta_traits.h index e2893f08..4454a81f 100644 --- a/include/proxy/v4/detail/facade_meta_traits.h +++ b/include/proxy/v5/detail/facade_meta_traits.h @@ -2,8 +2,8 @@ // Copyright (c) 2026-Present Next Gen C++ Foundation. // Licensed under the MIT License. -#ifndef MSFT_PROXY_V4_DETAIL_FACADE_META_TRAITS_H_ -#define MSFT_PROXY_V4_DETAIL_FACADE_META_TRAITS_H_ +#ifndef MSFT_PROXY_V5_DETAIL_FACADE_META_TRAITS_H_ +#define MSFT_PROXY_V5_DETAIL_FACADE_META_TRAITS_H_ #include #include @@ -12,17 +12,17 @@ #ifdef __has_feature #if __has_feature(ptrauth_calls) #include -#define PRO4D_HAS_PAC +#define PRO5D_HAS_PAC #endif // __has_feature(ptrauth_calls) #endif // __has_feature #include "../proxy_macros.h" -namespace pro::inline v4 { +namespace pro::inline v5 { namespace detail { -#ifdef PRO4D_HAS_PAC +#ifdef PRO5D_HAS_PAC template class code_ptr { public: @@ -105,7 +105,7 @@ using code_ptr = O*; template using meta_ptr = const T*; -#endif // PRO4D_HAS_PAC +#endif // PRO5D_HAS_PAC template struct invoker_base { @@ -125,7 +125,7 @@ struct invoker_base { template struct invoker; -#define PRO4D_DEF_INVOKER(oq, pq, ne, ...) \ +#define PRO5D_DEF_INVOKER(oq, pq, ne, ...) \ template \ struct invoker \ : invoker_base { \ @@ -137,8 +137,8 @@ struct invoker; return invoke

(ctx, std::forward(args)...); \ }) {} \ } -PRO4D_DEF_OVERLOAD_SPECIALIZATIONS(PRO4D_DEF_INVOKER) -#undef PRO4D_DEF_INVOKER +PRO5D_DEF_OVERLOAD_SPECIALIZATIONS(PRO5D_DEF_INVOKER) +#undef PRO5D_DEF_INVOKER template struct static_meta_storage { @@ -204,6 +204,6 @@ struct flat_facade_meta_traits { using storage = detail::inplace_meta_storage; }; -} // namespace pro::inline v4 +} // namespace pro::inline v5 -#endif // MSFT_PROXY_V4_DETAIL_FACADE_META_TRAITS_H_ +#endif // MSFT_PROXY_V5_DETAIL_FACADE_META_TRAITS_H_ diff --git a/include/proxy/v4/detail/proxy_creation.h b/include/proxy/v5/detail/proxy_creation.h similarity index 97% rename from include/proxy/v4/detail/proxy_creation.h rename to include/proxy/v5/detail/proxy_creation.h index af7cc082..081723fe 100644 --- a/include/proxy/v4/detail/proxy_creation.h +++ b/include/proxy/v5/detail/proxy_creation.h @@ -2,8 +2,8 @@ // Copyright (c) 2026-Present Next Gen C++ Foundation. // Licensed under the MIT License. -#ifndef MSFT_PROXY_V4_DETAIL_PROXY_CREATION_H_ -#define MSFT_PROXY_V4_DETAIL_PROXY_CREATION_H_ +#ifndef MSFT_PROXY_V5_DETAIL_PROXY_CREATION_H_ +#define MSFT_PROXY_V5_DETAIL_PROXY_CREATION_H_ #include #include @@ -15,7 +15,7 @@ #include "core.h" -namespace pro::inline v4 { +namespace pro::inline v5 { template concept inplace_proxiable_target = proxiable, F>; @@ -86,7 +86,7 @@ struct alloc_aware { explicit alloc_aware(const Alloc& alloc) noexcept : alloc(alloc) {} alloc_aware(const alloc_aware&) noexcept = default; - [[PRO4D_NO_UNIQUE_ADDRESS_ATTRIBUTE]] + [[PRO5D_NO_UNIQUE_ADDRESS_ATTRIBUTE]] Alloc alloc; }; template @@ -107,7 +107,7 @@ class indirect_ptr { }; template -class PRO4D_ENFORCE_EBO wide_ptr : private alloc_aware, +class PRO5D_ENFORCE_EBO wide_ptr : private alloc_aware, public indirect_ptr> { public: template @@ -127,7 +127,7 @@ class PRO4D_ENFORCE_EBO wide_ptr : private alloc_aware, }; template -struct PRO4D_ENFORCE_EBO compact_ptr_storage : alloc_aware, +struct PRO5D_ENFORCE_EBO compact_ptr_storage : alloc_aware, inplace_ptr { template explicit compact_ptr_storage(const Alloc& alloc, Args&&... args) @@ -157,7 +157,7 @@ struct shared_compact_ptr_storage_base { std::atomic_long ref_count = 1; }; template -struct PRO4D_ENFORCE_EBO shared_compact_ptr_storage +struct PRO5D_ENFORCE_EBO shared_compact_ptr_storage : shared_compact_ptr_storage_base, alloc_aware, inplace_ptr { @@ -425,6 +425,6 @@ constexpr proxy make_proxy_shared(std::initializer_list il, } #endif // __STDC_HOSTED__ -} // namespace pro::inline v4 +} // namespace pro::inline v5 -#endif // MSFT_PROXY_V4_DETAIL_PROXY_CREATION_H_ +#endif // MSFT_PROXY_V5_DETAIL_PROXY_CREATION_H_ diff --git a/include/proxy/v4/detail/skills.h b/include/proxy/v5/detail/skills.h similarity index 89% rename from include/proxy/v4/detail/skills.h rename to include/proxy/v5/detail/skills.h index f89064ce..bbd7a13e 100644 --- a/include/proxy/v4/detail/skills.h +++ b/include/proxy/v5/detail/skills.h @@ -2,8 +2,8 @@ // Copyright (c) 2026-Present Next Gen C++ Foundation. // Licensed under the MIT License. -#ifndef MSFT_PROXY_V4_DETAIL_SKILLS_H_ -#define MSFT_PROXY_V4_DETAIL_SKILLS_H_ +#ifndef MSFT_PROXY_V5_DETAIL_SKILLS_H_ +#define MSFT_PROXY_V5_DETAIL_SKILLS_H_ #include #include @@ -13,7 +13,7 @@ #if __cpp_lib_format >= 201907L || _LIBCPP_VERSION >= 170000 #include #include -#define PRO4D_HAS_FORMAT +#define PRO5D_HAS_FORMAT #endif // __cpp_lib_format || _LIBCPP_VERSION >= 170000 #endif // __STDC_HOSTED__ @@ -24,13 +24,13 @@ #include "core.h" -namespace pro::inline v4 { +namespace pro::inline v5 { #if __cpp_rtti >= 199711L class bad_proxy_cast : public std::bad_cast { public: char const* what() const noexcept override { - return "pro::v4::bad_proxy_cast"; + return "pro::v5::bad_proxy_cast"; } }; #endif // __cpp_rtti >= 199711L @@ -42,7 +42,7 @@ struct enabled_t {}; template class TT, class... Ctx> concept enabled_for = std::is_base_of_v, T>; -#define PRO4D_DEF_FAW_CAST_ACCESSOR(oq, pq, ne, ...) \ +#define PRO5D_DEF_FAW_CAST_ACCESSOR(oq, pq, ne, ...) \ template class TargetFacade> \ struct accessor, D, proxy>() oq ne> { \ template \ @@ -63,13 +63,13 @@ struct faw_cast_dispatch_base { struct accessor { accessor() = delete; }; - PRO4D_DEF_OVERLOAD_SPECIALIZATIONS(PRO4D_DEF_FAW_CAST_ACCESSOR) + PRO5D_DEF_OVERLOAD_SPECIALIZATIONS(PRO5D_DEF_FAW_CAST_ACCESSOR) }; -#undef PRO4D_DEF_FAW_CAST_ACCESSOR +#undef PRO5D_DEF_FAW_CAST_ACCESSOR struct view_conversion_dispatch : faw_cast_dispatch_base { template - PRO4D_STATIC_CALL(auto, T& value) noexcept + PRO5D_STATIC_CALL(auto, T& value) noexcept requires(requires { { std::addressof(*value) } noexcept; }) @@ -84,7 +84,7 @@ using view_conversion_overload = proxy_view() & noexcept; struct weak_conversion_dispatch : faw_cast_dispatch_base { template - PRO4D_STATIC_CALL(auto, const P& self) noexcept + PRO5D_STATIC_CALL(auto, const P& self) noexcept requires(requires(const typename P::weak_type& w) { { w.lock() } noexcept; } && std::is_convertible_v) @@ -109,7 +109,7 @@ struct format_traits { struct dispatch { template - PRO4D_STATIC_CALL(auto, const T& self, StringView spec, + PRO5D_STATIC_CALL(auto, const T& self, StringView spec, FormatContext& fc) requires(std::is_default_constructible_v>) { @@ -122,7 +122,7 @@ struct format_traits { } template - struct PRO4D_ENFORCE_EBO accessor : accessor... {}; + struct PRO5D_ENFORCE_EBO accessor : accessor... {}; template struct accessor> : enabled_t {}; template @@ -152,7 +152,7 @@ struct format_traits { }; }; -#ifdef PRO4D_HAS_FORMAT +#ifdef PRO5D_HAS_FORMAT template struct std_format_context_traits; template <> @@ -166,7 +166,7 @@ using std_format_context = std_format_context_traits::type; struct std_format_traits : format_traits {}; -#endif // PRO4D_HAS_FORMAT +#endif // PRO5D_HAS_FORMAT #if __cpp_rtti >= 199711L struct proxy_cast_context { @@ -190,7 +190,7 @@ struct proxy_cast_accessor_impl { .result_ptr = &result}; invoke_cast(static_cast(self), ctx); if (result == nullptr) [[unlikely]] { - PRO4D_THROW(bad_proxy_cast{}); + PRO5D_THROW(bad_proxy_cast{}); } return *static_cast(result); } else { @@ -201,7 +201,7 @@ struct proxy_cast_accessor_impl { .result_ptr = &result}; invoke_cast(static_cast(self), ctx); if (!result.has_value()) [[unlikely]] { - PRO4D_THROW(bad_proxy_cast{}); + PRO5D_THROW(bad_proxy_cast{}); } return std::move(*result); } @@ -243,13 +243,13 @@ struct proxy_cast_accessor_impl { } }; -#define PRO4D_DEF_PROXY_CAST_ACCESSOR(oq, pq, ne, ...) \ +#define PRO5D_DEF_PROXY_CAST_ACCESSOR(oq, pq, ne, ...) \ template \ struct accessor \ : proxy_cast_accessor_impl

{} struct proxy_cast_dispatch { template - PRO4D_STATIC_CALL(void, T&& self, proxy_cast_context ctx) { + PRO5D_STATIC_CALL(void, T&& self, proxy_cast_context ctx) { if (typeid(T) == *ctx.type_ptr) [[likely]] { if (ctx.is_ref) { if constexpr (std::is_lvalue_reference_v) { @@ -266,9 +266,9 @@ struct proxy_cast_dispatch { } } } - PRO4D_DEF_ACCESSOR_TEMPLATE(FREE, PRO4D_DEF_PROXY_CAST_ACCESSOR) + PRO5D_DEF_ACCESSOR_TEMPLATE(FREE, PRO5D_DEF_PROXY_CAST_ACCESSOR) }; -#undef PRO4D_DEF_PROXY_CAST_ACCESSOR +#undef PRO5D_DEF_PROXY_CAST_ACCESSOR struct proxy_typeid_reflector { proxy_typeid_reflector() = default; @@ -282,7 +282,7 @@ struct proxy_typeid_reflector { const proxy_typeid_reflector& refl = reflect(self); return *refl.info; } - PRO4D_DEBUG( + PRO5D_DEBUG( accessor() noexcept { std::ignore = &pro_symbol_guard; } private : static inline const std::type_info& pro_symbol_guard( @@ -296,7 +296,7 @@ struct direct_rtti_reflector : proxy_typeid_reflector { using proxy_typeid_reflector::proxy_typeid_reflector; template - struct PRO4D_ENFORCE_EBO accessor + struct PRO5D_ENFORCE_EBO accessor : proxy_typeid_reflector::accessor, proxy_cast_dispatch::accessor< Self, proxy_cast_dispatch, void(proxy_cast_context) &, @@ -308,7 +308,7 @@ struct direct_rtti_reflector : proxy_typeid_reflector { namespace skills { -#ifdef PRO4D_HAS_FORMAT +#ifdef PRO5D_HAS_FORMAT template using format = FB::template add_convention using wformat = FB::template add_convention>; -#endif // PRO4D_HAS_FORMAT +#endif // PRO5D_HAS_FORMAT #if __cpp_rtti >= 199711L template @@ -351,17 +351,17 @@ using as_weak = FB::template add_direct_convention< } // namespace skills -} // namespace pro::inline v4 +} // namespace pro::inline v5 -#ifdef PRO4D_HAS_FORMAT +#ifdef PRO5D_HAS_FORMAT namespace std { template - requires(pro::v4::detail::enabled_for) + requires(pro::v5::detail::enabled_for) struct formatter - : pro::v4::detail::std_format_traits::formatter {}; + : pro::v5::detail::std_format_traits::formatter {}; } // namespace std -#endif // PRO4D_HAS_FORMAT +#endif // PRO5D_HAS_FORMAT -#endif // MSFT_PROXY_V4_DETAIL_SKILLS_H_ +#endif // MSFT_PROXY_V5_DETAIL_SKILLS_H_ diff --git a/include/proxy/v4/proxy.h b/include/proxy/v5/proxy.h similarity index 89% rename from include/proxy/v4/proxy.h rename to include/proxy/v5/proxy.h index 848c6efa..3da216e5 100644 --- a/include/proxy/v4/proxy.h +++ b/include/proxy/v5/proxy.h @@ -2,8 +2,8 @@ // Copyright (c) 2026-Present Next Gen C++ Foundation. // Licensed under the MIT License. -#ifndef MSFT_PROXY_V4_PROXY_H_ -#define MSFT_PROXY_V4_PROXY_H_ +#ifndef MSFT_PROXY_V5_PROXY_H_ +#define MSFT_PROXY_V5_PROXY_H_ #include "detail/compatibility_check.h" // IWYU pragma: keep #include "detail/core.h" // IWYU pragma: export @@ -12,4 +12,4 @@ #include "detail/proxy_creation.h" // IWYU pragma: export #include "detail/skills.h" // IWYU pragma: export -#endif // MSFT_PROXY_V4_PROXY_H_ +#endif // MSFT_PROXY_V5_PROXY_H_ diff --git a/include/proxy/v5/proxy.ixx b/include/proxy/v5/proxy.ixx new file mode 100644 index 00000000..1400cff7 --- /dev/null +++ b/include/proxy/v5/proxy.ixx @@ -0,0 +1,74 @@ +module; + +#include + +export module proxy.v5; + +export namespace pro::inline v5 { + +#if __STDC_HOSTED__ +using v5::allocate_proxy; +using v5::allocate_proxy_shared; +using v5::make_proxy; +using v5::make_proxy_shared; +#endif // __STDC_HOSTED__ + +#if __cpp_rtti >= 199711L +using v5::bad_proxy_cast; +#endif // __cpp_rtti >= 199711L + +using v5::basic_facade_builder; +using v5::constraint_level; +using v5::conversion_dispatch; +using v5::explicit_conversion_dispatch; +using v5::facade; +using v5::facade_aware_overload_t; +using v5::facade_builder; +using v5::implicit_conversion_dispatch; +using v5::inplace_proxiable_target; +using v5::is_bitwise_trivially_relocatable; +using v5::is_bitwise_trivially_relocatable_v; +using v5::make_proxy_inplace; +using v5::make_proxy_view; +using v5::not_implemented; +using v5::observer_facade; +using v5::operator_dispatch; +using v5::proxiable; +using v5::proxiable_target; +using v5::proxy; +using v5::proxy_indirect_accessor; +using v5::proxy_invoke; +using v5::proxy_reflect; +using v5::proxy_view; +using v5::weak_dispatch; +using v5::weak_facade; +using v5::weak_proxy; + +namespace skills { + +#ifdef PRO5D_HAS_FORMAT +using skills::format; +using skills::wformat; +#endif // PRO5D_HAS_FORMAT + +#if __cpp_rtti >= 199711L +using skills::direct_rtti; +using skills::indirect_rtti; +using skills::rtti; +#endif // __cpp_rtti >= 199711L + +using skills::as_view; +using skills::as_weak; +using skills::slim; + +} // namespace skills + +} // namespace pro::inline v5 + +#ifdef PRO5D_HAS_FORMAT +export namespace std { + +using std::formatter; + +} // namespace std +#endif // PRO5D_HAS_FORMAT diff --git a/include/proxy/v4/proxy_fmt.h b/include/proxy/v5/proxy_fmt.h similarity index 79% rename from include/proxy/v4/proxy_fmt.h rename to include/proxy/v5/proxy_fmt.h index fa18be3f..77e3d205 100644 --- a/include/proxy/v4/proxy_fmt.h +++ b/include/proxy/v5/proxy_fmt.h @@ -2,22 +2,22 @@ // Copyright (c) 2026-Present Next Gen C++ Foundation. // Licensed under the MIT License. -#ifndef MSFT_PROXY_V4_PROXY_FMT_H_ -#define MSFT_PROXY_V4_PROXY_FMT_H_ +#ifndef MSFT_PROXY_V5_PROXY_FMT_H_ +#define MSFT_PROXY_V5_PROXY_FMT_H_ #include #include -#ifndef __msft_lib_proxy4 +#ifndef __msft_lib_proxy5 #error Please ensure that proxy.h is included before proxy_fmt.h. -#endif // __msft_lib_proxy4 +#endif // __msft_lib_proxy5 #if FMT_VERSION < 60100 #error Please ensure that the appropriate {fmt} headers (version 6.1.0 or \ later) are included before proxy_fmt.h. #endif // FMT_VERSION < 60100 -namespace pro::inline v4 { +namespace pro::inline v5 { namespace detail { @@ -48,15 +48,15 @@ using fmt_wformat = typename FB::template add_convention< } // namespace skills -} // namespace pro::inline v4 +} // namespace pro::inline v5 namespace fmt { template - requires(pro::v4::detail::enabled_for) + requires(pro::v5::detail::enabled_for) struct formatter - : pro::v4::detail::fmt_format_traits::formatter {}; + : pro::v5::detail::fmt_format_traits::formatter {}; } // namespace fmt -#endif // MSFT_PROXY_V4_PROXY_FMT_H_ +#endif // MSFT_PROXY_V5_PROXY_FMT_H_ diff --git a/include/proxy/v4/proxy_macros.h b/include/proxy/v5/proxy_macros.h similarity index 61% rename from include/proxy/v4/proxy_macros.h rename to include/proxy/v5/proxy_macros.h index 91cd07e2..1e54ad57 100644 --- a/include/proxy/v4/proxy_macros.h +++ b/include/proxy/v5/proxy_macros.h @@ -2,43 +2,43 @@ // Copyright (c) 2026-Present Next Gen C++ Foundation. // Licensed under the MIT License. -#ifndef MSFT_PROXY_V4_PROXY_MACROS_H_ -#define MSFT_PROXY_V4_PROXY_MACROS_H_ +#ifndef MSFT_PROXY_V5_PROXY_MACROS_H_ +#define MSFT_PROXY_V5_PROXY_MACROS_H_ #if __cpp_static_call_operator >= 202207L -#define PRO4D_STATIC_CALL(ret, ...) static ret operator()(__VA_ARGS__) +#define PRO5D_STATIC_CALL(ret, ...) static ret operator()(__VA_ARGS__) #else -#define PRO4D_STATIC_CALL(ret, ...) ret operator()(__VA_ARGS__) const +#define PRO5D_STATIC_CALL(ret, ...) ret operator()(__VA_ARGS__) const #endif // __cpp_static_call_operator >= 202207L #if __cpp_exceptions >= 199711L -#define PRO4D_THROW(...) throw __VA_ARGS__ +#define PRO5D_THROW(...) throw __VA_ARGS__ #else -#define PRO4D_THROW(...) std::abort() +#define PRO5D_THROW(...) std::abort() #endif // __cpp_exceptions >= 199711L #ifdef _MSC_VER -#define PRO4D_ENFORCE_EBO __declspec(empty_bases) +#define PRO5D_ENFORCE_EBO __declspec(empty_bases) #else -#define PRO4D_ENFORCE_EBO +#define PRO5D_ENFORCE_EBO #endif // _MSC_VER #ifdef NDEBUG -#define PRO4D_DEBUG(...) +#define PRO5D_DEBUG(...) #else -#define PRO4D_DEBUG(...) __VA_ARGS__ +#define PRO5D_DEBUG(...) __VA_ARGS__ #endif // NDEBUG -#define __msft_lib_proxy4 202606L +#define __msft_lib_proxy5 202606L -#define PRO4D_DIRECT_FUNC_IMPL(...) \ +#define PRO5D_DIRECT_FUNC_IMPL(...) \ noexcept(noexcept(__VA_ARGS__)) \ requires(requires { __VA_ARGS__; }) \ { \ return __VA_ARGS__; \ } -#define PRO4D_DEF_OVERLOAD_SPECIALIZATIONS(macro, ...) \ +#define PRO5D_DEF_OVERLOAD_SPECIALIZATIONS(macro, ...) \ macro(, &, , __VA_ARGS__); \ macro(, &, noexcept, __VA_ARGS__); \ macro(&, &, , __VA_ARGS__); \ @@ -52,57 +52,57 @@ macro(const&&, const&&, , __VA_ARGS__); \ macro(const&&, const&&, noexcept, __VA_ARGS__); -#define PRO4D_DEF_AGGREGATE_MEM_ACCESSOR_BODY(...) \ +#define PRO5D_DEF_AGGREGATE_MEM_ACCESSOR_BODY(...) \ using accessor::__VA_ARGS__...; -#define PRO4D_DEF_AGGREGATE_FREE_ACCESSOR_BODY(...) -#define PRO4D_DEF_ACCESSOR_TEMPLATE(type, macro, ...) \ +#define PRO5D_DEF_AGGREGATE_FREE_ACCESSOR_BODY(...) +#define PRO5D_DEF_ACCESSOR_TEMPLATE(type, macro, ...) \ template \ - struct PRO4D_ENFORCE_EBO accessor { \ + struct PRO5D_ENFORCE_EBO accessor { \ accessor() = delete; \ }; \ template \ requires(sizeof...(ProOs) > 1u && \ (::std::is_constructible_v> && ...)) \ struct accessor : accessor... { \ - PRO4D_DEF_AGGREGATE_##type##_ACCESSOR_BODY(__VA_ARGS__) \ + PRO5D_DEF_AGGREGATE_##type##_ACCESSOR_BODY(__VA_ARGS__) \ }; \ - PRO4D_DEF_OVERLOAD_SPECIALIZATIONS(macro, __VA_ARGS__) + PRO5D_DEF_OVERLOAD_SPECIALIZATIONS(macro, __VA_ARGS__) -#define PRO4D_GEN_DEBUG_SYMBOL_FOR_MEM_ACCESSOR(...) \ - PRO4D_DEBUG(accessor() noexcept { ::std::ignore = &accessor::__VA_ARGS__; }) +#define PRO5D_GEN_DEBUG_SYMBOL_FOR_MEM_ACCESSOR(...) \ + PRO5D_DEBUG(accessor() noexcept { ::std::ignore = &accessor::__VA_ARGS__; }) -#define PRO4D_EXPAND_IMPL(x) x +#define PRO5D_EXPAND_IMPL(x) x -#define PRO4D_EXPAND_MACRO_IMPL(macro, _1, _2, _3, name, ...) macro##_##name -#define PRO4D_EXPAND_MACRO(macro, ...) \ - PRO4D_EXPAND_IMPL( \ - PRO4D_EXPAND_MACRO_IMPL(macro, __VA_ARGS__, 3, 2)(__VA_ARGS__)) +#define PRO5D_EXPAND_MACRO_IMPL(macro, _1, _2, _3, name, ...) macro##_##name +#define PRO5D_EXPAND_MACRO(macro, ...) \ + PRO5D_EXPAND_IMPL( \ + PRO5D_EXPAND_MACRO_IMPL(macro, __VA_ARGS__, 3, 2)(__VA_ARGS__)) -#define PRO4D_DEF_MEM_ACCESSOR(oq, pq, ne, ...) \ +#define PRO5D_DEF_MEM_ACCESSOR(oq, pq, ne, ...) \ template \ struct accessor { \ - PRO4D_GEN_DEBUG_SYMBOL_FOR_MEM_ACCESSOR(__VA_ARGS__) \ + PRO5D_GEN_DEBUG_SYMBOL_FOR_MEM_ACCESSOR(__VA_ARGS__) \ ProR __VA_ARGS__(ProArgs... pro_args) oq ne { \ return invoke( \ static_cast(*this), ::std::forward(pro_args)...); \ } \ } -#define PRO4D_DEF_MEM_DISPATCH_IMPL(name, impl, func) \ +#define PRO5D_DEF_MEM_DISPATCH_IMPL(name, impl, func) \ struct name { \ template \ - PRO4D_STATIC_CALL(decltype(auto), ProT&& pro_self, ProArgs&&... pro_args) \ - PRO4D_DIRECT_FUNC_IMPL(::std::forward(pro_self).impl( \ + PRO5D_STATIC_CALL(decltype(auto), ProT&& pro_self, ProArgs&&... pro_args) \ + PRO5D_DIRECT_FUNC_IMPL(::std::forward(pro_self).impl( \ ::std::forward(pro_args)...)) \ - PRO4D_DEF_ACCESSOR_TEMPLATE(MEM, PRO4D_DEF_MEM_ACCESSOR, func) \ + PRO5D_DEF_ACCESSOR_TEMPLATE(MEM, PRO5D_DEF_MEM_ACCESSOR, func) \ } -#define PRO4D_DEF_MEM_DISPATCH_2(name, impl) \ - PRO4D_DEF_MEM_DISPATCH_IMPL(name, impl, impl) -#define PRO4D_DEF_MEM_DISPATCH_3(name, impl, func) \ - PRO4D_DEF_MEM_DISPATCH_IMPL(name, impl, func) -#define PRO4_DEF_MEM_DISPATCH(name, ...) \ - PRO4D_EXPAND_MACRO(PRO4D_DEF_MEM_DISPATCH, name, __VA_ARGS__) - -#define PRO4D_DEF_FREE_ACCESSOR(oq, pq, ne, ...) \ +#define PRO5D_DEF_MEM_DISPATCH_2(name, impl) \ + PRO5D_DEF_MEM_DISPATCH_IMPL(name, impl, impl) +#define PRO5D_DEF_MEM_DISPATCH_3(name, impl, func) \ + PRO5D_DEF_MEM_DISPATCH_IMPL(name, impl, func) +#define PRO5_DEF_MEM_DISPATCH(name, ...) \ + PRO5D_EXPAND_MACRO(PRO5D_DEF_MEM_DISPATCH, name, __VA_ARGS__) + +#define PRO5D_DEF_FREE_ACCESSOR(oq, pq, ne, ...) \ template \ struct accessor { \ friend ProR __VA_ARGS__(ProP pq pro_self, ProArgs... pro_args) ne { \ @@ -110,7 +110,7 @@ static_cast(pro_self), \ ::std::forward(pro_args)...); \ } \ - PRO4D_DEBUG( \ + PRO5D_DEBUG( \ accessor() noexcept { ::std::ignore = &pro_symbol_guard; } \ \ private: \ @@ -121,85 +121,85 @@ } \ ) \ } -#define PRO4D_DEF_FREE_DISPATCH_IMPL(name, impl, func) \ +#define PRO5D_DEF_FREE_DISPATCH_IMPL(name, impl, func) \ struct name { \ template \ - PRO4D_STATIC_CALL(decltype(auto), ProT&& pro_self, ProArgs&&... pro_args) \ - PRO4D_DIRECT_FUNC_IMPL(impl(::std::forward(pro_self), \ + PRO5D_STATIC_CALL(decltype(auto), ProT&& pro_self, ProArgs&&... pro_args) \ + PRO5D_DIRECT_FUNC_IMPL(impl(::std::forward(pro_self), \ ::std::forward(pro_args)...)) \ - PRO4D_DEF_ACCESSOR_TEMPLATE(FREE, PRO4D_DEF_FREE_ACCESSOR, func) \ + PRO5D_DEF_ACCESSOR_TEMPLATE(FREE, PRO5D_DEF_FREE_ACCESSOR, func) \ } -#define PRO4D_DEF_FREE_DISPATCH_2(name, impl) \ - PRO4D_DEF_FREE_DISPATCH_IMPL(name, impl, impl) -#define PRO4D_DEF_FREE_DISPATCH_3(name, impl, func) \ - PRO4D_DEF_FREE_DISPATCH_IMPL(name, impl, func) -#define PRO4_DEF_FREE_DISPATCH(name, ...) \ - PRO4D_EXPAND_MACRO(PRO4D_DEF_FREE_DISPATCH, name, __VA_ARGS__) - -#define PRO4D_DEF_FREE_AS_MEM_DISPATCH_IMPL(name, impl, func) \ +#define PRO5D_DEF_FREE_DISPATCH_2(name, impl) \ + PRO5D_DEF_FREE_DISPATCH_IMPL(name, impl, impl) +#define PRO5D_DEF_FREE_DISPATCH_3(name, impl, func) \ + PRO5D_DEF_FREE_DISPATCH_IMPL(name, impl, func) +#define PRO5_DEF_FREE_DISPATCH(name, ...) \ + PRO5D_EXPAND_MACRO(PRO5D_DEF_FREE_DISPATCH, name, __VA_ARGS__) + +#define PRO5D_DEF_FREE_AS_MEM_DISPATCH_IMPL(name, impl, func) \ struct name { \ template \ - PRO4D_STATIC_CALL(decltype(auto), ProT&& pro_self, ProArgs&&... pro_args) \ - PRO4D_DIRECT_FUNC_IMPL(impl(::std::forward(pro_self), \ + PRO5D_STATIC_CALL(decltype(auto), ProT&& pro_self, ProArgs&&... pro_args) \ + PRO5D_DIRECT_FUNC_IMPL(impl(::std::forward(pro_self), \ ::std::forward(pro_args)...)) \ - PRO4D_DEF_ACCESSOR_TEMPLATE(MEM, PRO4D_DEF_MEM_ACCESSOR, func) \ + PRO5D_DEF_ACCESSOR_TEMPLATE(MEM, PRO5D_DEF_MEM_ACCESSOR, func) \ } -#define PRO4D_DEF_FREE_AS_MEM_DISPATCH_2(name, impl) \ - PRO4D_DEF_FREE_AS_MEM_DISPATCH_IMPL(name, impl, impl) -#define PRO4D_DEF_FREE_AS_MEM_DISPATCH_3(name, impl, func) \ - PRO4D_DEF_FREE_AS_MEM_DISPATCH_IMPL(name, impl, func) -#define PRO4_DEF_FREE_AS_MEM_DISPATCH(name, ...) \ - PRO4D_EXPAND_MACRO(PRO4D_DEF_FREE_AS_MEM_DISPATCH, name, __VA_ARGS__) +#define PRO5D_DEF_FREE_AS_MEM_DISPATCH_2(name, impl) \ + PRO5D_DEF_FREE_AS_MEM_DISPATCH_IMPL(name, impl, impl) +#define PRO5D_DEF_FREE_AS_MEM_DISPATCH_3(name, impl, func) \ + PRO5D_DEF_FREE_AS_MEM_DISPATCH_IMPL(name, impl, func) +#define PRO5_DEF_FREE_AS_MEM_DISPATCH(name, ...) \ + PRO5D_EXPAND_MACRO(PRO5D_DEF_FREE_AS_MEM_DISPATCH, name, __VA_ARGS__) // Version-less macro aliases -#define PRO4D_AMBIGUOUS_MACRO_DIAGNOSTIC_ASSERT(name, qualified_name) \ +#define PRO5D_AMBIGUOUS_MACRO_DIAGNOSTIC_ASSERT(name, qualified_name) \ static_assert(false, "The use of macro `" #name "` is ambiguous. \ Are multiple different versions of Proxy library included at the same time?\n\ Note: To resolve this error: \n\ - Either make sure that only one version of Proxy library is included within this file.\n\ -- Or use the `" #qualified_name "` macro (note the `4` suffix) to explicitly \ +- Or use the `" #qualified_name "` macro (note the `5` suffix) to explicitly \ stick to a specific major version of the Proxy library.") #ifdef __msft_lib_proxy #undef __msft_lib_proxy #define __msft_lib_proxy \ [] { \ - PRO4D_AMBIGUOUS_MACRO_DIAGNOSTIC_ASSERT(__msft_lib_proxy, \ - __msft_lib_proxy4); \ + PRO5D_AMBIGUOUS_MACRO_DIAGNOSTIC_ASSERT(__msft_lib_proxy, \ + __msft_lib_proxy5); \ return 0L; \ }() #else -#define __msft_lib_proxy __msft_lib_proxy4 +#define __msft_lib_proxy __msft_lib_proxy5 #endif // __msft_lib_proxy #ifdef PRO_DEF_MEM_DISPATCH #undef PRO_DEF_MEM_DISPATCH #define PRO_DEF_MEM_DISPATCH(...) \ - PRO4D_AMBIGUOUS_MACRO_DIAGNOSTIC_ASSERT(PRO_DEF_MEM_DISPATCH, \ - PRO4_DEF_MEM_DISPATCH) + PRO5D_AMBIGUOUS_MACRO_DIAGNOSTIC_ASSERT(PRO_DEF_MEM_DISPATCH, \ + PRO5_DEF_MEM_DISPATCH) #else -#define PRO_DEF_MEM_DISPATCH(name, ...) PRO4_DEF_MEM_DISPATCH(name, __VA_ARGS__) +#define PRO_DEF_MEM_DISPATCH(name, ...) PRO5_DEF_MEM_DISPATCH(name, __VA_ARGS__) #endif // PRO_DEF_MEM_DISPATCH #ifdef PRO_DEF_FREE_DISPATCH #undef PRO_DEF_FREE_DISPATCH #define PRO_DEF_FREE_DISPATCH(...) \ - PRO4D_AMBIGUOUS_MACRO_DIAGNOSTIC_ASSERT(PRO_DEF_FREE_DISPATCH, \ - PRO4_DEF_FREE_DISPATCH) + PRO5D_AMBIGUOUS_MACRO_DIAGNOSTIC_ASSERT(PRO_DEF_FREE_DISPATCH, \ + PRO5_DEF_FREE_DISPATCH) #else #define PRO_DEF_FREE_DISPATCH(name, ...) \ - PRO4_DEF_FREE_DISPATCH(name, __VA_ARGS__) + PRO5_DEF_FREE_DISPATCH(name, __VA_ARGS__) #endif // PRO_DEF_FREE_DISPATCH #ifdef PRO_DEF_FREE_AS_MEM_DISPATCH #undef PRO_DEF_FREE_AS_MEM_DISPATCH #define PRO_DEF_FREE_AS_MEM_DISPATCH(...) \ - PRO4D_AMBIGUOUS_MACRO_DIAGNOSTIC_ASSERT(PRO_DEF_FREE_AS_MEM_DISPATCH, \ - PRO4_DEF_FREE_AS_MEM_DISPATCH) + PRO5D_AMBIGUOUS_MACRO_DIAGNOSTIC_ASSERT(PRO_DEF_FREE_AS_MEM_DISPATCH, \ + PRO5_DEF_FREE_AS_MEM_DISPATCH) #else #define PRO_DEF_FREE_AS_MEM_DISPATCH(name, ...) \ - PRO4_DEF_FREE_AS_MEM_DISPATCH(name, __VA_ARGS__) + PRO5_DEF_FREE_AS_MEM_DISPATCH(name, __VA_ARGS__) #endif // PRO_DEF_FREE_AS_MEM_DISPATCH -#endif // MSFT_PROXY_V4_PROXY_MACROS_H_ +#endif // MSFT_PROXY_V5_PROXY_MACROS_H_ diff --git a/meson.build b/meson.build index e3b6ad65..291568c4 100644 --- a/meson.build +++ b/meson.build @@ -1,7 +1,7 @@ project( - 'msft_proxy4', + 'msft_proxy5', 'cpp', - version: '4.1.0', + version: '5.0.0', license: 'MIT', license_files: 'LICENSE', meson_version: '>=1.3', @@ -50,7 +50,7 @@ endif inc = include_directories('include') -msft_proxy4_dep = declare_dependency( +msft_proxy5_dep = declare_dependency( include_directories: inc, ) @@ -70,7 +70,7 @@ if pkgconfig.found() ) endif -meson.override_dependency(meson.project_name(), msft_proxy4_dep) +meson.override_dependency(meson.project_name(), msft_proxy5_dep) tests = get_option('tests').disable_auto_if(meson.is_subproject()) diff --git a/mkdocs.yml b/mkdocs.yml index 556f54af..3b61f0f6 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -1,5 +1,5 @@ --- -site_name: Proxy 4 +site_name: Proxy 5 site_url: https://ngcpp.github.io/proxy site_description: Next Generation Polymorphism in C++ copyright: Copyright (c) 2022-2026 Microsoft Corporation
Copyright (c) 2026-Present Next Gen C++ Foundation diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 434789b7..b9deef62 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -31,7 +31,7 @@ add_executable( target_include_directories(msft_proxy_tests PRIVATE .) target_link_libraries( msft_proxy_tests - PRIVATE msft_proxy4::proxy gtest_main fmt::fmt + PRIVATE msft_proxy5::proxy gtest_main fmt::fmt ) target_compile_options(msft_proxy_tests PRIVATE ${PROXY_STRICT_WARNING_FLAGS}) gtest_discover_tests(msft_proxy_tests) diff --git a/tests/freestanding/CMakeLists.txt b/tests/freestanding/CMakeLists.txt index 2c1f5921..61a77d45 100644 --- a/tests/freestanding/CMakeLists.txt +++ b/tests/freestanding/CMakeLists.txt @@ -3,7 +3,7 @@ target_compile_options( msft_proxy_freestanding_tests PRIVATE ${PROXY_STRICT_WARNING_FLAGS} ) -target_link_libraries(msft_proxy_freestanding_tests PRIVATE msft_proxy4::proxy) +target_link_libraries(msft_proxy_freestanding_tests PRIVATE msft_proxy5::proxy) add_test(NAME ProxyFreestandingTests COMMAND msft_proxy_freestanding_tests) if(PROXY_BUILD_MODULES) @@ -17,7 +17,7 @@ if(PROXY_BUILD_MODULES) ) target_link_libraries( msft_proxy_freestanding_module_tests - PRIVATE msft_proxy4::proxy_module + PRIVATE msft_proxy5::proxy_module ) add_test( NAME ProxyFreestandingModuleSupportTests diff --git a/tests/freestanding/meson.build b/tests/freestanding/meson.build index 7dcfffb3..3b12c5f3 100644 --- a/tests/freestanding/meson.build +++ b/tests/freestanding/meson.build @@ -4,7 +4,7 @@ test( 'msft_proxy_freestanding_tests', files('proxy_freestanding_tests.cpp'), implicit_include_directories: false, - dependencies: msft_proxy4_dep, + dependencies: msft_proxy5_dep, override_options: { 'werror': true, }, diff --git a/tests/freestanding/proxy_freestanding_module_tests.cpp b/tests/freestanding/proxy_freestanding_module_tests.cpp index fcebb0e5..17ae3666 100644 --- a/tests/freestanding/proxy_freestanding_module_tests.cpp +++ b/tests/freestanding/proxy_freestanding_module_tests.cpp @@ -12,7 +12,7 @@ #include #include -import proxy.v4; +import proxy.v5; constexpr unsigned DefaultHash = -1; unsigned GetHashImpl(int v) { return static_cast(v + 3) * 31; } diff --git a/tests/meson.build b/tests/meson.build index 7486537c..1bf359ef 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -14,7 +14,7 @@ test_srcs = files( 'proxy_view_tests.cpp', ) -test_deps = [msft_proxy4_dep, gtest_dep] +test_deps = [msft_proxy5_dep, gtest_dep] if fmt_dep.found() test_srcs += files( diff --git a/tests/modules/CMakeLists.txt b/tests/modules/CMakeLists.txt index 0183f813..bc9ef9be 100644 --- a/tests/modules/CMakeLists.txt +++ b/tests/modules/CMakeLists.txt @@ -4,5 +4,5 @@ if(PROXY_BUILD_MODULES) msft_proxy_tests PRIVATE FILE_SET CXX_MODULES FILES foo.ixx impl.ixx ) - target_link_libraries(msft_proxy_tests PRIVATE msft_proxy4::proxy_module) + target_link_libraries(msft_proxy_tests PRIVATE msft_proxy5::proxy_module) endif() diff --git a/tests/modules/foo.ixx b/tests/modules/foo.ixx index 6a071c11..d4a8149e 100644 --- a/tests/modules/foo.ixx +++ b/tests/modules/foo.ixx @@ -7,7 +7,7 @@ module; export module foo; -import proxy.v4; +import proxy.v5; extern "C++" { PRO_DEF_MEM_DISPATCH(MemGetFoo, GetFoo); diff --git a/tests/modules/main.cpp b/tests/modules/main.cpp index 15962dcd..0caf22c9 100644 --- a/tests/modules/main.cpp +++ b/tests/modules/main.cpp @@ -1,7 +1,7 @@ #include #include -import proxy.v4; +import proxy.v5; import foo; import foo_impl; diff --git a/tests/proxy_dispatch_tests.cpp b/tests/proxy_dispatch_tests.cpp index 96c5bb85..cd1dd3bf 100644 --- a/tests/proxy_dispatch_tests.cpp +++ b/tests/proxy_dispatch_tests.cpp @@ -832,7 +832,7 @@ TEST(ProxyDispatchTests, TestFreeAsMemDispatch) { } TEST(ProxyDispatchTests, TestSuperConversion) { -#ifdef PRO4D_HAS_FORMAT +#ifdef PRO5D_HAS_FORMAT struct Base : pro::facade_builder // ::add_skill // ::support_copy // @@ -859,5 +859,5 @@ TEST(ProxyDispatchTests, TestSuperConversion) { ASSERT_EQ(std::format("{}", *p6), "456"); #else GTEST_SKIP() << "std::format not available"; -#endif // PRO4D_HAS_FORMAT +#endif // PRO5D_HAS_FORMAT } diff --git a/tests/proxy_format_tests.cpp b/tests/proxy_format_tests.cpp index b57e1cd0..0e170e13 100644 --- a/tests/proxy_format_tests.cpp +++ b/tests/proxy_format_tests.cpp @@ -5,7 +5,7 @@ #include #include -#ifdef PRO4D_HAS_FORMAT +#ifdef PRO5D_HAS_FORMAT namespace proxy_format_tests_detail { struct NonFormattable : pro::facade_builder::build {}; @@ -31,26 +31,26 @@ static_assert( } // namespace proxy_format_tests_detail namespace detail = proxy_format_tests_detail; -#endif // PRO4D_HAS_FORMAT +#endif // PRO5D_HAS_FORMAT TEST(ProxyFormatTests, TestFormat) { -#ifdef PRO4D_HAS_FORMAT +#ifdef PRO5D_HAS_FORMAT int v = 123; pro::proxy p = &v; ASSERT_EQ(std::format("{}", *p), "123"); ASSERT_EQ(std::format("{:*<6}", *p), "123***"); #else GTEST_SKIP() << "std::format not available"; -#endif // PRO4D_HAS_FORMAT +#endif // PRO5D_HAS_FORMAT } TEST(ProxyFormatTests, TestWformat) { -#ifdef PRO4D_HAS_FORMAT +#ifdef PRO5D_HAS_FORMAT int v = 123; pro::proxy p = &v; ASSERT_EQ(std::format(L"{}", *p), L"123"); ASSERT_EQ(std::format(L"{:*<6}", *p), L"123***"); #else GTEST_SKIP() << "std::format not available"; -#endif // PRO4D_HAS_FORMAT +#endif // PRO5D_HAS_FORMAT } diff --git a/tests/proxy_pac_tests.cpp b/tests/proxy_pac_tests.cpp index e3c56f5f..8f51f152 100644 --- a/tests/proxy_pac_tests.cpp +++ b/tests/proxy_pac_tests.cpp @@ -4,7 +4,7 @@ #include -#ifdef PRO4D_HAS_PAC +#ifdef PRO5D_HAS_PAC #include #include #include @@ -129,4 +129,4 @@ TEST(ProxyPacTests, TestRelocationAttack_StaticMetaStorage) { }, ""); } -#endif // PRO4D_HAS_PAC +#endif // PRO5D_HAS_PAC diff --git a/tests/proxy_traits_tests.cpp b/tests/proxy_traits_tests.cpp index 0fcabdcc..61c87746 100644 --- a/tests/proxy_traits_tests.cpp +++ b/tests/proxy_traits_tests.cpp @@ -210,7 +210,7 @@ struct TrivialFacade : pro::facade_builder // ::support_relocation // ::support_destruction // ::build {}; -#ifdef PRO4D_HAS_PAC +#ifdef PRO5D_HAS_PAC static_assert(std::is_nothrow_copy_constructible_v>); static_assert(std::is_nothrow_copy_assignable_v>); static_assert(std::is_nothrow_move_constructible_v>); @@ -222,7 +222,7 @@ static_assert(std::is_trivially_copy_assignable_v>); static_assert( std::is_trivially_move_constructible_v>); static_assert(std::is_trivially_move_assignable_v>); -#endif // PRO4D_HAS_PAC +#endif // PRO5D_HAS_PAC static_assert(std::is_trivially_destructible_v>); static_assert(!pro::proxiable); static_assert(!pro::proxiable); diff --git a/tests/proxy_view_tests.cpp b/tests/proxy_view_tests.cpp index 87a13eb6..f370487f 100644 --- a/tests/proxy_view_tests.cpp +++ b/tests/proxy_view_tests.cpp @@ -30,13 +30,13 @@ static_assert( SupportsToString>())>); static_assert(sizeof(pro::proxy) == 3 * sizeof(void*)); -#ifdef PRO4D_HAS_PAC +#ifdef PRO5D_HAS_PAC static_assert( std::is_nothrow_copy_constructible_v>); #else static_assert( std::is_trivially_copy_constructible_v>); -#endif // PRO4D_HAS_PAC +#endif // PRO5D_HAS_PAC static_assert(std::is_trivially_destructible_v>); static_assert(SupportsIntPlusEqual< decltype(*std::declval>())>);