ORNL / cpp-proposals-pub

Collaborating on papers for the ISO C++ committee - public repo
26 stars 26 forks source link

P2897R0 (aligned_accessor): LEWG feedback 2023/10/10 #410

Closed mhoemmen closed 11 months ago

mhoemmen commented 11 months ago

LEWG review of P2897R0 (aligned_accessor) on 2023/10/10

Feedback

Please see also https://github.com/cplusplus/papers/issues/1568 .

Design alternatives

One design alternative for expressing the alignment precondition on the pointer would be to introduce an aligned_pointer_t type (not alias), as in the example currently in the mdspan repository. The type's constructor would take a pointer and impose an alignment precondition on the pointer. This would shift the burden for checking preconditions from the mdspan as a whole, to data_handle_type itself. That way, mdspan itself wouldn't need a system for checking preconditions, yet (from the user's perspective) preconditions would still be checked at mdspan creation time.