]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libstdc++: Implement submdspan_mapping_result. [PR110352]
authorLuc Grosheintz <luc.grosheintz@gmail.com>
Thu, 2 Oct 2025 09:27:16 +0000 (11:27 +0200)
committerTomasz Kamiński <tkaminsk@redhat.com>
Wed, 8 Oct 2025 10:39:44 +0000 (12:39 +0200)
Implement the class submdspan_mapping_result and add it to the std
module.

PR libstdc++/110352

libstdc++-v3/ChangeLog:

* include/std/mdspan (submdspan_mapping_result): New class.
* src/c++23/std.cc.in (submdspan_mapping_result): Add.

Reviewed-by: Jonathan Wakely <jwakely@redhat.com>
Reviewed-by: Tomasz Kamiński <tkaminsk@redhat.com>
Signed-off-by: Luc Grosheintz <luc.grosheintz@gmail.com>
libstdc++-v3/include/std/mdspan
libstdc++-v3/src/c++23/std.cc.in

index 7f69626e4e86ffff7cda1fa304d57b460a4b6489..d555b7f2580ade1d5b0e263aeef5866a479f4d57 100644 (file)
@@ -361,6 +361,13 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       [[no_unique_address]] extent_type extent{};
       [[no_unique_address]] stride_type stride{};
     };
+
+  template<typename _Mapping>
+    struct submdspan_mapping_result
+    {
+      [[no_unique_address]] _Mapping mapping = _Mapping();
+      size_t offset{};
+    };
 #endif
 
   template<typename _IndexType, size_t... _Extents>
index bfccf3cec9561664a6b7b555d51c457afa9df403..9cf5fa7dcb62fac32a85ded5a60bfa55d747c14e 100644 (file)
@@ -1875,8 +1875,9 @@ export namespace std
   using strided_slice;
   using full_extent_t;
   using full_extent;
+  using submdspan_mapping_result;
 #endif
-  // FIXME submdspan_mapping_result, submdspan_extents, mdsubspan
+  // FIXME submdspan_extents, mdsubspan
 }
 #endif