From Jason Turner

[mdspan.mdspan]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpqyrl1ilh/{from.md → to.md} +71 -286
tmp/tmpqyrl1ilh/{from.md → to.md} RENAMED
@@ -11,18 +11,18 @@ namespace std {
11
  class mdspan {
12
  public:
13
  using extents_type = Extents;
14
  using layout_type = LayoutPolicy;
15
  using accessor_type = AccessorPolicy;
16
- using mapping_type = typename layout_type::template mapping<extents_type>;
17
  using element_type = ElementType;
18
  using value_type = remove_cv_t<element_type>;
19
- using index_type = typename extents_type::index_type;
20
- using size_type = typename extents_type::size_type;
21
- using rank_type = typename extents_type::rank_type;
22
- using data_handle_type = typename accessor_type::data_handle_type;
23
- using reference = typename accessor_type::reference;
24
 
25
  static constexpr rank_type rank() noexcept { return extents_type::rank(); }
26
  static constexpr rank_type rank_dynamic() noexcept { return extents_type::rank_dynamic(); }
27
  static constexpr size_t static_extent(rank_type r) noexcept
28
  { return extents_type::static_extent(r); }
@@ -60,12 +60,22 @@ namespace std {
60
  template<class OtherIndexType>
61
  constexpr reference operator[](span<OtherIndexType, rank()> indices) const;
62
  template<class OtherIndexType>
63
  constexpr reference operator[](const array<OtherIndexType, rank()>& indices) const;
64
 
 
 
 
 
 
 
 
 
 
 
65
  constexpr size_type size() const noexcept;
66
- [[nodiscard]] constexpr bool empty() const noexcept;
67
 
68
  friend constexpr void swap(mdspan& x, mdspan& y) noexcept;
69
 
70
  constexpr const extents_type& extents() const noexcept { return map_.extents(); }
71
  constexpr const data_handle_type& data_handle() const noexcept { return ptr_; }
@@ -105,11 +115,11 @@ namespace std {
105
  -> mdspan<remove_pointer_t<remove_reference_t<Pointer>>, extents<size_t>>;
106
 
107
  template<class ElementType, class... Integrals>
108
  requires ((is_convertible_v<Integrals, size_t> && ...) && sizeof...(Integrals) > 0)
109
  explicit mdspan(ElementType*, Integrals...)
110
- -> mdspan<ElementType, dextents<size_t, sizeof...(Integrals)>>;
111
 
112
  template<class ElementType, class OtherIndexType, size_t N>
113
  mdspan(ElementType*, span<OtherIndexType, N>)
114
  -> mdspan<ElementType, dextents<size_t, N>>;
115
 
@@ -212,12 +222,12 @@ template<class OtherIndexType, size_t N>
212
  ```
213
 
214
  *Constraints:*
215
 
216
  - `is_convertible_v<const OtherIndexType&, index_type>` is `true`,
217
- - `(is_nothrow_constructible<index_type, const OtherIndexType&> && ...)`
218
- is `true`,
219
  - `N == rank() || N == rank_dynamic()` is `true`,
220
  - `is_constructible_v<mapping_type, extents_type>` is `true`, and
221
  - `is_default_constructible_v<accessor_type>` is `true`.
222
 
223
  *Preconditions:* $[0, \texttt{\textit{map_}.required_span_size()})$ is
@@ -296,18 +306,17 @@ template<class OtherElementType, class OtherExtents,
296
 
297
  - `is_constructible_v<data_handle_type, const OtherAccessor::data_handle_type&>`
298
  is `true`, and
299
  - `is_constructible_v<extents_type, OtherExtents>` is `true`.
300
 
301
- *Preconditions:*
 
 
302
 
303
- - For each rank index `r` of `extents_type`,
304
  `static_extent(r) == dynamic_extent || static_extent(r) == other.extent(r)`
305
  is `true`.
306
- - $[0, \texttt{\textit{map_}.required_span_size()})$ is an accessible
307
- range of *ptr\_* and *acc\_* for values of *ptr\_*, *map\_*, and
308
- *acc\_* after the invocation of this constructor.
309
 
310
  *Effects:*
311
 
312
  - Direct-non-list-initializes *ptr\_* with `other.`*`ptr_`*,
313
  - direct-non-list-initializes *map\_* with `other.`*`map_`*, and
@@ -334,11 +343,11 @@ template<class... OtherIndexTypes>
334
  `true`, and
335
  - `sizeof...(OtherIndexTypes) == rank()` is `true`.
336
 
337
  Let `I` be `extents_type::`*`index-cast`*`(std::move(indices))`.
338
 
339
- *Preconditions:* `I` is a multidimensional index in `extents()`.
340
 
341
  [*Note 1*: This implies that
342
  *`map_`*`(I) < `*`map_`*`.required_span_size()` is
343
  `true`. — *end note*]
344
 
@@ -368,11 +377,55 @@ is_same_v<make_index_sequence<rank()>, index_sequence<P...>>
368
  ```
369
 
370
  is `true`. Equivalent to:
371
 
372
  ``` cpp
373
- return operator[](as_const(indices[P])...);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
374
  ```
375
 
376
  ``` cpp
377
  constexpr size_type size() const noexcept;
378
  ```
@@ -382,11 +435,11 @@ constexpr size_type size() const noexcept;
382
  [[basic.fundamental]].
383
 
384
  *Returns:* `extents().`*`fwd-prod-of-extents`*`(rank())`.
385
 
386
  ``` cpp
387
- [[nodiscard]] constexpr bool empty() const noexcept;
388
  ```
389
 
390
  *Returns:* `true` if the size of the multidimensional index space
391
  `extents()` is 0, otherwise `false`.
392
 
@@ -400,273 +453,5 @@ friend constexpr void swap(mdspan& x, mdspan& y) noexcept;
400
  swap(x.ptr_, y.ptr_);
401
  swap(x.map_, y.map_);
402
  swap(x.acc_, y.acc_);
403
  ```
404
 
405
- <!-- Link reference definitions -->
406
- [alg.equal]: algorithms.md#alg.equal
407
- [alg.sorting]: algorithms.md#alg.sorting
408
- [algorithm.stable]: library.md#algorithm.stable
409
- [algorithms]: algorithms.md#algorithms
410
- [algorithms.requirements]: algorithms.md#algorithms.requirements
411
- [allocator.requirements]: library.md#allocator.requirements
412
- [allocator.requirements.completeness]: library.md#allocator.requirements.completeness
413
- [allocator.traits.members]: mem.md#allocator.traits.members
414
- [allocator.uses.construction]: mem.md#allocator.uses.construction
415
- [array]: #array
416
- [array.cons]: #array.cons
417
- [array.creation]: #array.creation
418
- [array.members]: #array.members
419
- [array.overview]: #array.overview
420
- [array.special]: #array.special
421
- [array.syn]: #array.syn
422
- [array.tuple]: #array.tuple
423
- [array.zero]: #array.zero
424
- [associative]: #associative
425
- [associative.general]: #associative.general
426
- [associative.map.syn]: #associative.map.syn
427
- [associative.reqmts]: #associative.reqmts
428
- [associative.reqmts.except]: #associative.reqmts.except
429
- [associative.reqmts.general]: #associative.reqmts.general
430
- [associative.set.syn]: #associative.set.syn
431
- [basic.fundamental]: basic.md#basic.fundamental
432
- [basic.string]: strings.md#basic.string
433
- [class.copy.ctor]: class.md#class.copy.ctor
434
- [class.default.ctor]: class.md#class.default.ctor
435
- [class.dtor]: class.md#class.dtor
436
- [container.adaptors]: #container.adaptors
437
- [container.adaptors.format]: #container.adaptors.format
438
- [container.adaptors.general]: #container.adaptors.general
439
- [container.alloc.reqmts]: #container.alloc.reqmts
440
- [container.gen.reqmts]: #container.gen.reqmts
441
- [container.insert.return]: #container.insert.return
442
- [container.node]: #container.node
443
- [container.node.compat]: #container.node.compat
444
- [container.node.cons]: #container.node.cons
445
- [container.node.dtor]: #container.node.dtor
446
- [container.node.modifiers]: #container.node.modifiers
447
- [container.node.observers]: #container.node.observers
448
- [container.node.overview]: #container.node.overview
449
- [container.opt.reqmts]: #container.opt.reqmts
450
- [container.reqmts]: #container.reqmts
451
- [container.requirements]: #container.requirements
452
- [container.requirements.dataraces]: #container.requirements.dataraces
453
- [container.requirements.general]: #container.requirements.general
454
- [container.requirements.pre]: #container.requirements.pre
455
- [container.rev.reqmts]: #container.rev.reqmts
456
- [containers]: #containers
457
- [containers.general]: #containers.general
458
- [containers.summary]: #containers.summary
459
- [dcl.init.aggr]: dcl.md#dcl.init.aggr
460
- [defns.valid]: intro.md#defns.valid
461
- [deque]: #deque
462
- [deque.capacity]: #deque.capacity
463
- [deque.cons]: #deque.cons
464
- [deque.erasure]: #deque.erasure
465
- [deque.modifiers]: #deque.modifiers
466
- [deque.overview]: #deque.overview
467
- [deque.syn]: #deque.syn
468
- [expr.const]: expr.md#expr.const
469
- [flat.map]: #flat.map
470
- [flat.map.access]: #flat.map.access
471
- [flat.map.capacity]: #flat.map.capacity
472
- [flat.map.cons]: #flat.map.cons
473
- [flat.map.defn]: #flat.map.defn
474
- [flat.map.erasure]: #flat.map.erasure
475
- [flat.map.modifiers]: #flat.map.modifiers
476
- [flat.map.overview]: #flat.map.overview
477
- [flat.map.syn]: #flat.map.syn
478
- [flat.multimap]: #flat.multimap
479
- [flat.multimap.cons]: #flat.multimap.cons
480
- [flat.multimap.defn]: #flat.multimap.defn
481
- [flat.multimap.erasure]: #flat.multimap.erasure
482
- [flat.multimap.overview]: #flat.multimap.overview
483
- [flat.multiset]: #flat.multiset
484
- [flat.multiset.cons]: #flat.multiset.cons
485
- [flat.multiset.defn]: #flat.multiset.defn
486
- [flat.multiset.erasure]: #flat.multiset.erasure
487
- [flat.multiset.modifiers]: #flat.multiset.modifiers
488
- [flat.multiset.overview]: #flat.multiset.overview
489
- [flat.set]: #flat.set
490
- [flat.set.cons]: #flat.set.cons
491
- [flat.set.defn]: #flat.set.defn
492
- [flat.set.erasure]: #flat.set.erasure
493
- [flat.set.modifiers]: #flat.set.modifiers
494
- [flat.set.overview]: #flat.set.overview
495
- [flat.set.syn]: #flat.set.syn
496
- [forward.iterators]: iterators.md#forward.iterators
497
- [forward.list]: #forward.list
498
- [forward.list.access]: #forward.list.access
499
- [forward.list.cons]: #forward.list.cons
500
- [forward.list.erasure]: #forward.list.erasure
501
- [forward.list.iter]: #forward.list.iter
502
- [forward.list.modifiers]: #forward.list.modifiers
503
- [forward.list.ops]: #forward.list.ops
504
- [forward.list.overview]: #forward.list.overview
505
- [forward.list.syn]: #forward.list.syn
506
- [hash.requirements]: library.md#hash.requirements
507
- [iterator.concept.contiguous]: iterators.md#iterator.concept.contiguous
508
- [iterator.concept.random.access]: iterators.md#iterator.concept.random.access
509
- [iterator.requirements]: iterators.md#iterator.requirements
510
- [iterator.requirements.general]: iterators.md#iterator.requirements.general
511
- [list]: #list
512
- [list.capacity]: #list.capacity
513
- [list.cons]: #list.cons
514
- [list.erasure]: #list.erasure
515
- [list.modifiers]: #list.modifiers
516
- [list.ops]: #list.ops
517
- [list.overview]: #list.overview
518
- [list.syn]: #list.syn
519
- [map]: #map
520
- [map.access]: #map.access
521
- [map.cons]: #map.cons
522
- [map.erasure]: #map.erasure
523
- [map.modifiers]: #map.modifiers
524
- [map.overview]: #map.overview
525
- [mdspan.accessor]: #mdspan.accessor
526
- [mdspan.accessor.default]: #mdspan.accessor.default
527
- [mdspan.accessor.default.members]: #mdspan.accessor.default.members
528
- [mdspan.accessor.default.overview]: #mdspan.accessor.default.overview
529
- [mdspan.accessor.general]: #mdspan.accessor.general
530
- [mdspan.accessor.reqmts]: #mdspan.accessor.reqmts
531
- [mdspan.extents]: #mdspan.extents
532
- [mdspan.extents.cmp]: #mdspan.extents.cmp
533
- [mdspan.extents.cons]: #mdspan.extents.cons
534
- [mdspan.extents.dextents]: #mdspan.extents.dextents
535
- [mdspan.extents.expo]: #mdspan.extents.expo
536
- [mdspan.extents.obs]: #mdspan.extents.obs
537
- [mdspan.extents.overview]: #mdspan.extents.overview
538
- [mdspan.layout]: #mdspan.layout
539
- [mdspan.layout.general]: #mdspan.layout.general
540
- [mdspan.layout.left]: #mdspan.layout.left
541
- [mdspan.layout.left.cons]: #mdspan.layout.left.cons
542
- [mdspan.layout.left.obs]: #mdspan.layout.left.obs
543
- [mdspan.layout.left.overview]: #mdspan.layout.left.overview
544
- [mdspan.layout.policy.overview]: #mdspan.layout.policy.overview
545
- [mdspan.layout.policy.reqmts]: #mdspan.layout.policy.reqmts
546
- [mdspan.layout.reqmts]: #mdspan.layout.reqmts
547
- [mdspan.layout.right]: #mdspan.layout.right
548
- [mdspan.layout.right.cons]: #mdspan.layout.right.cons
549
- [mdspan.layout.right.obs]: #mdspan.layout.right.obs
550
- [mdspan.layout.right.overview]: #mdspan.layout.right.overview
551
- [mdspan.layout.stride]: #mdspan.layout.stride
552
- [mdspan.layout.stride.cons]: #mdspan.layout.stride.cons
553
- [mdspan.layout.stride.expo]: #mdspan.layout.stride.expo
554
- [mdspan.layout.stride.obs]: #mdspan.layout.stride.obs
555
- [mdspan.layout.stride.overview]: #mdspan.layout.stride.overview
556
- [mdspan.mdspan]: #mdspan.mdspan
557
- [mdspan.mdspan.cons]: #mdspan.mdspan.cons
558
- [mdspan.mdspan.members]: #mdspan.mdspan.members
559
- [mdspan.mdspan.overview]: #mdspan.mdspan.overview
560
- [mdspan.overview]: #mdspan.overview
561
- [mdspan.syn]: #mdspan.syn
562
- [multimap]: #multimap
563
- [multimap.cons]: #multimap.cons
564
- [multimap.erasure]: #multimap.erasure
565
- [multimap.modifiers]: #multimap.modifiers
566
- [multimap.overview]: #multimap.overview
567
- [multiset]: #multiset
568
- [multiset.cons]: #multiset.cons
569
- [multiset.erasure]: #multiset.erasure
570
- [multiset.overview]: #multiset.overview
571
- [priority.queue]: #priority.queue
572
- [priqueue.cons]: #priqueue.cons
573
- [priqueue.cons.alloc]: #priqueue.cons.alloc
574
- [priqueue.members]: #priqueue.members
575
- [priqueue.overview]: #priqueue.overview
576
- [priqueue.special]: #priqueue.special
577
- [queue]: #queue
578
- [queue.cons]: #queue.cons
579
- [queue.cons.alloc]: #queue.cons.alloc
580
- [queue.defn]: #queue.defn
581
- [queue.mod]: #queue.mod
582
- [queue.ops]: #queue.ops
583
- [queue.special]: #queue.special
584
- [queue.syn]: #queue.syn
585
- [random.access.iterators]: iterators.md#random.access.iterators
586
- [res.on.data.races]: library.md#res.on.data.races
587
- [sequence.reqmts]: #sequence.reqmts
588
- [sequences]: #sequences
589
- [sequences.general]: #sequences.general
590
- [set]: #set
591
- [set.cons]: #set.cons
592
- [set.erasure]: #set.erasure
593
- [set.overview]: #set.overview
594
- [span.cons]: #span.cons
595
- [span.deduct]: #span.deduct
596
- [span.elem]: #span.elem
597
- [span.iterators]: #span.iterators
598
- [span.objectrep]: #span.objectrep
599
- [span.obs]: #span.obs
600
- [span.overview]: #span.overview
601
- [span.sub]: #span.sub
602
- [span.syn]: #span.syn
603
- [stack]: #stack
604
- [stack.cons]: #stack.cons
605
- [stack.cons.alloc]: #stack.cons.alloc
606
- [stack.defn]: #stack.defn
607
- [stack.general]: #stack.general
608
- [stack.mod]: #stack.mod
609
- [stack.ops]: #stack.ops
610
- [stack.special]: #stack.special
611
- [stack.syn]: #stack.syn
612
- [strings]: strings.md#strings
613
- [swappable.requirements]: library.md#swappable.requirements
614
- [temp.deduct]: temp.md#temp.deduct
615
- [temp.param]: temp.md#temp.param
616
- [temp.type]: temp.md#temp.type
617
- [term.trivially.copyable.type]: basic.md#term.trivially.copyable.type
618
- [unord]: #unord
619
- [unord.general]: #unord.general
620
- [unord.hash]: utilities.md#unord.hash
621
- [unord.map]: #unord.map
622
- [unord.map.cnstr]: #unord.map.cnstr
623
- [unord.map.elem]: #unord.map.elem
624
- [unord.map.erasure]: #unord.map.erasure
625
- [unord.map.modifiers]: #unord.map.modifiers
626
- [unord.map.overview]: #unord.map.overview
627
- [unord.map.syn]: #unord.map.syn
628
- [unord.multimap]: #unord.multimap
629
- [unord.multimap.cnstr]: #unord.multimap.cnstr
630
- [unord.multimap.erasure]: #unord.multimap.erasure
631
- [unord.multimap.modifiers]: #unord.multimap.modifiers
632
- [unord.multimap.overview]: #unord.multimap.overview
633
- [unord.multiset]: #unord.multiset
634
- [unord.multiset.cnstr]: #unord.multiset.cnstr
635
- [unord.multiset.erasure]: #unord.multiset.erasure
636
- [unord.multiset.overview]: #unord.multiset.overview
637
- [unord.req]: #unord.req
638
- [unord.req.except]: #unord.req.except
639
- [unord.req.general]: #unord.req.general
640
- [unord.set]: #unord.set
641
- [unord.set.cnstr]: #unord.set.cnstr
642
- [unord.set.erasure]: #unord.set.erasure
643
- [unord.set.overview]: #unord.set.overview
644
- [unord.set.syn]: #unord.set.syn
645
- [vector]: #vector
646
- [vector.bool]: #vector.bool
647
- [vector.bool.fmt]: #vector.bool.fmt
648
- [vector.bool.pspc]: #vector.bool.pspc
649
- [vector.capacity]: #vector.capacity
650
- [vector.cons]: #vector.cons
651
- [vector.data]: #vector.data
652
- [vector.erasure]: #vector.erasure
653
- [vector.modifiers]: #vector.modifiers
654
- [vector.overview]: #vector.overview
655
- [vector.syn]: #vector.syn
656
- [views]: #views
657
- [views.contiguous]: #views.contiguous
658
- [views.general]: #views.general
659
- [views.multidim]: #views.multidim
660
- [views.span]: #views.span
661
-
662
- [^1]: Equality comparison is a refinement of partitioning if no two
663
- objects that compare equal fall into different partitions.
664
-
665
- [^2]: These member functions are only provided by containers whose
666
- iterators are random access iterators.
667
-
668
- [^3]: As specified in  [[allocator.requirements]], the requirements in
669
- this Clause apply only to lists whose allocators compare equal.
670
-
671
- [^4]: `reserve()` uses `Allocator::allocate()` which can throw an
672
- appropriate exception.
 
11
  class mdspan {
12
  public:
13
  using extents_type = Extents;
14
  using layout_type = LayoutPolicy;
15
  using accessor_type = AccessorPolicy;
16
+ using mapping_type = layout_type::template mapping<extents_type>;
17
  using element_type = ElementType;
18
  using value_type = remove_cv_t<element_type>;
19
+ using index_type = extents_type::index_type;
20
+ using size_type = extents_type::size_type;
21
+ using rank_type = extents_type::rank_type;
22
+ using data_handle_type = accessor_type::data_handle_type;
23
+ using reference = accessor_type::reference;
24
 
25
  static constexpr rank_type rank() noexcept { return extents_type::rank(); }
26
  static constexpr rank_type rank_dynamic() noexcept { return extents_type::rank_dynamic(); }
27
  static constexpr size_t static_extent(rank_type r) noexcept
28
  { return extents_type::static_extent(r); }
 
60
  template<class OtherIndexType>
61
  constexpr reference operator[](span<OtherIndexType, rank()> indices) const;
62
  template<class OtherIndexType>
63
  constexpr reference operator[](const array<OtherIndexType, rank()>& indices) const;
64
 
65
+ template<class... OtherIndexTypes>
66
+ constexpr reference
67
+ at(OtherIndexTypes... indices) const; // freestanding-deleted
68
+ template<class OtherIndexType>
69
+ constexpr reference
70
+ at(span<OtherIndexType, rank()> indices) const; // freestanding-deleted
71
+ template<class OtherIndexType>
72
+ constexpr reference
73
+ at(const array<OtherIndexType, rank()>& indices) const; // freestanding-deleted
74
+
75
  constexpr size_type size() const noexcept;
76
+ constexpr bool empty() const noexcept;
77
 
78
  friend constexpr void swap(mdspan& x, mdspan& y) noexcept;
79
 
80
  constexpr const extents_type& extents() const noexcept { return map_.extents(); }
81
  constexpr const data_handle_type& data_handle() const noexcept { return ptr_; }
 
115
  -> mdspan<remove_pointer_t<remove_reference_t<Pointer>>, extents<size_t>>;
116
 
117
  template<class ElementType, class... Integrals>
118
  requires ((is_convertible_v<Integrals, size_t> && ...) && sizeof...(Integrals) > 0)
119
  explicit mdspan(ElementType*, Integrals...)
120
+ -> mdspan<ElementType, extents<size_t, maybe-static-ext<Integrals>...>>;
121
 
122
  template<class ElementType, class OtherIndexType, size_t N>
123
  mdspan(ElementType*, span<OtherIndexType, N>)
124
  -> mdspan<ElementType, dextents<size_t, N>>;
125
 
 
222
  ```
223
 
224
  *Constraints:*
225
 
226
  - `is_convertible_v<const OtherIndexType&, index_type>` is `true`,
227
+ - `is_nothrow_constructible_v<index_type, const OtherIndexType&>` is
228
+ `true`,
229
  - `N == rank() || N == rank_dynamic()` is `true`,
230
  - `is_constructible_v<mapping_type, extents_type>` is `true`, and
231
  - `is_default_constructible_v<accessor_type>` is `true`.
232
 
233
  *Preconditions:* $[0, \texttt{\textit{map_}.required_span_size()})$ is
 
306
 
307
  - `is_constructible_v<data_handle_type, const OtherAccessor::data_handle_type&>`
308
  is `true`, and
309
  - `is_constructible_v<extents_type, OtherExtents>` is `true`.
310
 
311
+ *Preconditions:* $[0, \texttt{\textit{map_}.required_span_size()})$ is
312
+ an accessible range of *ptr\_* and *acc\_* for values of *ptr\_*,
313
+ *map\_*, and *acc\_* after the invocation of this constructor.
314
 
315
+ For each rank index `r` of `extents_type`,
316
  `static_extent(r) == dynamic_extent || static_extent(r) == other.extent(r)`
317
  is `true`.
 
 
 
318
 
319
  *Effects:*
320
 
321
  - Direct-non-list-initializes *ptr\_* with `other.`*`ptr_`*,
322
  - direct-non-list-initializes *map\_* with `other.`*`map_`*, and
 
343
  `true`, and
344
  - `sizeof...(OtherIndexTypes) == rank()` is `true`.
345
 
346
  Let `I` be `extents_type::`*`index-cast`*`(std::move(indices))`.
347
 
348
+ `I` is a multidimensional index in `extents()`.
349
 
350
  [*Note 1*: This implies that
351
  *`map_`*`(I) < `*`map_`*`.required_span_size()` is
352
  `true`. — *end note*]
353
 
 
377
  ```
378
 
379
  is `true`. Equivalent to:
380
 
381
  ``` cpp
382
+ return operator[](extents_type::index-cast(as_const(indices[P]))...);
383
+ ```
384
+
385
+ ``` cpp
386
+ template<class... OtherIndexTypes>
387
+ constexpr reference at(OtherIndexTypes... indices) const;
388
+ ```
389
+
390
+ *Constraints:*
391
+
392
+ - `(is_convertible_v<OtherIndexTypes, index_type> && ...)` is `true`,
393
+ - `(is_nothrow_constructible_v<index_type, OtherIndexTypes> && ...)` is
394
+ `true`, and
395
+ - `sizeof...(OtherIndexTypes) == rank()` is `true`.
396
+
397
+ Let `I` be `extents_type::`*`index-cast`*`(std::move(indices))`.
398
+
399
+ *Returns:* `(*this)[I...]`.
400
+
401
+ *Throws:* `out_of_range` if `I` is not a multidimensional index in
402
+ `extents()`.
403
+
404
+ ``` cpp
405
+ template<class OtherIndexType>
406
+ constexpr reference at(span<OtherIndexType, rank()> indices) const;
407
+ template<class OtherIndexType>
408
+ constexpr reference at(const array<OtherIndexType, rank()>& indices) const;
409
+ ```
410
+
411
+ *Constraints:*
412
+
413
+ - `is_convertible_v<const OtherIndexType&, index_type>` is `true`, and
414
+ - `is_nothrow_constructible_v<index_type, const OtherIndexType&>` is
415
+ `true`.
416
+
417
+ *Effects:* Let `P` be a parameter pack such that
418
+
419
+ ``` cpp
420
+ is_same_v<make_index_sequence<rank()>, index_sequence<P...>>
421
+ ```
422
+
423
+ is `true`. Equivalent to:
424
+
425
+ ``` cpp
426
+ return at(extents_type::index-cast(as_const(indices[P]))...);
427
  ```
428
 
429
  ``` cpp
430
  constexpr size_type size() const noexcept;
431
  ```
 
435
  [[basic.fundamental]].
436
 
437
  *Returns:* `extents().`*`fwd-prod-of-extents`*`(rank())`.
438
 
439
  ``` cpp
440
+ constexpr bool empty() const noexcept;
441
  ```
442
 
443
  *Returns:* `true` if the size of the multidimensional index space
444
  `extents()` is 0, otherwise `false`.
445
 
 
453
  swap(x.ptr_, y.ptr_);
454
  swap(x.map_, y.map_);
455
  swap(x.acc_, y.acc_);
456
  ```
457