Repository navigation
Add public rfl::type_name<T>() / type_name_v<T> and rfl::num_fields_v<T> - #127
Closed
clockblocker wants to merge 1 commit into
Closed
clockblocker wants to merge 1 commit into
clockblocker wants to merge 1 commit into
Conversation
… rfl::num_fields_v<T>
This was referenced Nov 28, 2026
Owner
Author
|
Superseded by:
Closing this bundled PR. |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Exposes public compile-time
<rfl/type_name.hpp>(rfl::type_name<T>()/rfl::type_name_v<T>) andrfl::num_fields_v<T>in<rfl/num_fields.hpp>, and fixes a dangling-temporary bug inrfl::internal::get_type_name_str_view<T>(). Purely additive on the public API.Example
Key details
rfl::type_name<T>()andrfl::type_name_v<T>return a null-terminatedstd::string_viewbacked by staticinline constexprstorage (works inconstexpr,static_assert, and runtime under C++20 and C++26 without instantiatingrfl::Literalor leaking__PRETTY_FUNCTION__into.rodata).rfl::internal::get_type_name_str_view<T>()returning astd::string_viewinto a temporaryStringLiteralprvalue.NVIDIA/cuda-quantum) to call privaterfl::internal::get_type_name_str_viewor instantiaterfl::named_tuple_t<T>::size()just to read a field count.AI-authored.