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