FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Add P3795 to C++26 features by sefyan0hack · Pull Request #176 · cdervis/cppstat · GitHub

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .md  (1) .yaml  (1) All 2 file types selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
30 changes: 30 additions & 0 deletions content/miscellaneous-reflection-cleanup.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
@@ -0,0 +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.

- `std::meta::current_function()`
- `std::meta::current_class()`
- `std::meta::current_namespace()`
- `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`.
- Some existing type traits had no reflection-time equivalents.
- Reflection error reporting was underspecified and inconsistent.

## Example

```cpp
#include <meta>
#include <print>

int main() {
std::println("{}", std::meta::identifier_of(std::meta::current_function())); // prints: main
}
```
7 changes: 7 additions & 0 deletions features_cpp26.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -1675,3 +1675,10 @@ features:
paper: P3913
lib: true
support: [GCC 16]

- desc: "Miscellaneous Reflection Cleanup"
paper: P3795
summary: "Fills gaps in the reflection API, adding `current_function()`, `current_class()` and `current_namespace()`, among others."
lib: true
content: miscellaneous-reflection-cleanup.md
keywords: ["reflection"]
Loading

Back | FazBrowse Home | New Git URL