|
welder 0.1.0
Bindings for annotated C++ types, from C++26 reflection
|
Splice-based accessors for data member Mem — the pointer-to-member-free route the rods bind a protected field through. More...
#include <welder/bind_traits.hpp>
Public Types | |
| using | class_type = typename [:std::meta::parent_of(Mem):] |
| The declaring class. | |
| using | field_type = typename [:std::meta::type_of(Mem):] |
| The field's declared type (const included). | |
Static Public Member Functions | |
| static const field_type & | get (const class_type &c) |
| Read the field (a reference, so backends can apply their reference-internal return semantics, matching the pointer-to-member path). | |
| static void | set (class_type &c, const field_type &v) |
| Write the field (instantiated only for mutable fields). | |
Splice-based accessors for data member Mem — the pointer-to-member-free route the rods bind a protected field through.
[gcc-16 workaround, isolated here] gcc-16 access-checks a dependent &[:Mem:] on a protected data member ("protected within this context"), although the identical splice passes in a non-dependent context and the dependent &[:Fn:] on a protected member function passes too — under P2996 none of them should be checked (access applies to names; a splice is not a name, and the access decision was already taken by the access_context at query time). std::meta::extract<F C::*>(Mem) trips the same check. The member-*access* splice obj.[:Mem:] does not, so a protected field binds as a property over these two accessors instead of a def_readwrite-style pointer-to-member. Both spellings are standard; fold back to &[:Mem:] when gcc's check is fixed.
The class type is Mem's declaring class, so a flattened base's field reads through the base reference (exactly as a base pointer-to-member would).
| Mem | a reflection of the (non-static) data member. |
Definition at line 242 of file bind_traits.hpp.
| using welder::detail::field_access< Mem >::class_type = typename [:std::meta::parent_of(Mem):] |
The declaring class.
Definition at line 244 of file bind_traits.hpp.
| using welder::detail::field_access< Mem >::field_type = typename [:std::meta::type_of(Mem):] |
The field's declared type (const included).
Definition at line 246 of file bind_traits.hpp.
|
inlinestatic |
Read the field (a reference, so backends can apply their reference-internal return semantics, matching the pointer-to-member path).
| c | the object. |
Definition at line 251 of file bind_traits.hpp.
|
inlinestatic |
Write the field (instantiated only for mutable fields).
| c | the object. |
| v | the new value. |
Definition at line 254 of file bind_traits.hpp.