Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions content/miscellaneous-ceflection-cleanup.md
Original file line number Diff line number Diff line change
@@ -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 <print>
#include <meta>

int main() {
std::printf("{}", std::meta::identifier_of(std::meta::current_function())); // output: main
}

```
6 changes: 6 additions & 0 deletions features_cpp26.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1675,3 +1675,9 @@
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

Check failure on line 1683 in features_cpp26.yaml

View workflow job for this annotation

GitHub Actions / YAML lint

1683:49 [new-line-at-end-of-file] no new line character at the end of file
Loading