[mdspan.accessor.reqmts] (original) (raw)

23 Containers library [containers]

23.7 Views [views]

23.7.3 Multidimensional access [views.multidim]

23.7.3.5 Accessor policy [mdspan.accessor]

23.7.3.5.2 Requirements [mdspan.accessor.reqmts]

A type A meets the accessor policy requirements if

Result: A complete object type that is not an abstract class type.

typename A::data_handle_type

Result: A type that models copyable, and for which is_nothrow_move_constructible_v<A​::​data_handle_type> is true,is_nothrow_move_assignable_v<A​::​data_handle_type> is true, andis_nothrow_swappable_v<A​::​data_handle_type> is true.

[Note 1:

The type of data_handle_type need not be element_type*.

— _end note_]

Result: A type that modelscommon_reference_with<A​::​reference&&, A​::​element_type&>.

[Note 2:

The type of reference need not be element_type&.

— _end note_]

typename A::offset_policy

Result: A type OP such that:

Remarks: The expression is equality preserving.

[Note 3:

Concrete accessor policies can impose preconditions for their access function.

However, they might not.

For example, an accessor wherep is span<A​::​element_type, dynamic_extent> andaccess(p, i) returns p[i % p.size()]does not need to impose a precondition on i.

— _end note_]

Result: A​::​offset_policy​::​data_handle_type

Returns: q such that for b being A​::​offset_policy(a), and any integer n for which [0, n) is an accessible range of p and a:

Remarks: The expression is equality-preserving.