From c2fc7c21d7f19324524776efbfa32d7f9c25f460 Mon Sep 17 00:00:00 2001 From: sefyan0hack Date: Sun, 31 May 2026 12:50:45 +0100 Subject: [PATCH 1/2] add PP3795 to c++26 features --- content/miscellaneous-ceflection-cleanup.md | 29 +++++++++++++++++++++ features_cpp26.yaml | 6 +++++ 2 files changed, 35 insertions(+) create mode 100644 content/miscellaneous-ceflection-cleanup.md diff --git a/content/miscellaneous-ceflection-cleanup.md b/content/miscellaneous-ceflection-cleanup.md new file mode 100644 index 0000000..4d49e82 --- /dev/null +++ b/content/miscellaneous-ceflection-cleanup.md @@ -0,0 +1,29 @@ +## What It Does + +P3795R2 is a cleanup and consistency proposal for the new C++26 Reflection facilities. It does not introduce major new reflection capabilities, but fills gaps and unifies APIs that were left inconsistent after several reflection-related papers were adopted together. + +- `std::meta::current_function()` +- `std::meta::current_class()` +- `std::meta::current_namespace()` +- `is_applicable_type()` +- `is_nothrow_applicable_type()` +- `apply_result()` + +## Why It Matters + +- Determining the current class or namespace required indirect workarounds through `access_context`. +- Some existing type traits had no reflection-time equivalents. +- Reflection error reporting was underspecified and inconsistent. + +## Example + +```cpp + +#include +#include + +int main() { + std::printf("{}", std::meta::identifier_of(std::meta::current_function())); // output: main +} + +``` \ No newline at end of file diff --git a/features_cpp26.yaml b/features_cpp26.yaml index da01fdc..c7eed84 100644 --- a/features_cpp26.yaml +++ b/features_cpp26.yaml @@ -1675,3 +1675,9 @@ features: paper: P3913 lib: true support: [GCC 16] + + - desc: "Miscellaneous Reflection Cleanup" + paper: P3795 + summary: "adding missing predicates `current_class` `current_function` `current_namespace` ..." + lib: true + content: miscellaneous-ceflection-cleanup.md \ No newline at end of file From d0af1661a20c1f8d991936dfbbd61c0d13e4c679 Mon Sep 17 00:00:00 2001 From: Cem Dervis Date: Sun, 19 Jul 2026 11:33:21 +0200 Subject: [PATCH 2/2] Fix PR --- ...md => miscellaneous-reflection-cleanup.md} | 21 ++++++++++--------- features_cpp26.yaml | 5 +++-- 2 files changed, 14 insertions(+), 12 deletions(-) rename content/{miscellaneous-ceflection-cleanup.md => miscellaneous-reflection-cleanup.md} (50%) diff --git a/content/miscellaneous-ceflection-cleanup.md b/content/miscellaneous-reflection-cleanup.md similarity index 50% rename from content/miscellaneous-ceflection-cleanup.md rename to content/miscellaneous-reflection-cleanup.md index 4d49e82..07ae476 100644 --- a/content/miscellaneous-ceflection-cleanup.md +++ b/content/miscellaneous-reflection-cleanup.md @@ -1,29 +1,30 @@ ## What It Does -P3795R2 is a cleanup and consistency proposal for the new C++26 Reflection facilities. It does not introduce major new reflection capabilities, but fills gaps and unifies APIs that were left inconsistent after several reflection-related papers were adopted together. +P3795R2 is a cleanup and consistency proposal for the new C++26 reflection facilities. It does +not introduce major new reflection capabilities, but fills gaps and unifies APIs that were left +inconsistent after several reflection-related papers were adopted together. - `std::meta::current_function()` - `std::meta::current_class()` - `std::meta::current_namespace()` -- `is_applicable_type()` -- `is_nothrow_applicable_type()` -- `apply_result()` +- `std::meta::is_applicable_type()` +- `std::meta::is_nothrow_applicable_type()` +- `std::meta::apply_result()` ## Why It Matters -- Determining the current class or namespace required indirect workarounds through `access_context`. +- Determining the current class or namespace required indirect workarounds through + `access_context`. - Some existing type traits had no reflection-time equivalents. - Reflection error reporting was underspecified and inconsistent. ## Example ```cpp - -#include #include +#include int main() { - std::printf("{}", std::meta::identifier_of(std::meta::current_function())); // output: main + std::println("{}", std::meta::identifier_of(std::meta::current_function())); // prints: main } - -``` \ No newline at end of file +``` diff --git a/features_cpp26.yaml b/features_cpp26.yaml index c7eed84..0ca6b67 100644 --- a/features_cpp26.yaml +++ b/features_cpp26.yaml @@ -1678,6 +1678,7 @@ features: - desc: "Miscellaneous Reflection Cleanup" paper: P3795 - summary: "adding missing predicates `current_class` `current_function` `current_namespace` ..." + summary: "Fills gaps in the reflection API, adding `current_function()`, `current_class()` and `current_namespace()`, among others." lib: true - content: miscellaneous-ceflection-cleanup.md \ No newline at end of file + content: miscellaneous-reflection-cleanup.md + keywords: ["reflection"]