Replace IsAligned marker struct with const generic in bevy_ptr #18085
Labels
A-Pointers
Relating to Bevy pointer abstractions
C-Usability
A targeted quality-of-life change that makes Bevy easier to use
D-Straightforward
Simple bug fixes and API improvements, docs, test and examples
What problem does this solve or what need does it fill?
The
Ptr
,PtrMut
andOwningPtr
types use a marker struct to indicate whether the pointer is aligned. It may be more appropriate to use a const generic parameter instead.What solution would you like?
Replace the
Ptr
,PtrMut
andOwningPtr
declarations with variations on the following:Perhaps also replace use of the boolean literals true and false with
ALIGNED
andUNALIGNED
for readability (Ptr::<ALIGNED>
rather thanPtr::<true>
)Additional context
Supercedes #17988 and thus #18042
The text was updated successfully, but these errors were encountered: