Luc Grosheintz 8c71d18f54 libstdc++: Implement std::layout_left_padded [PR110352].
This commit adds a new layout layout_left_padded as standardized in
N5014. It adds a purely internal feature testing macro padded_layouts
and registers layout_left_padded in the std module.

This commit implements LWG4372, because without it's not possible
to properly test padded layouts with a dynamic padding value. It also
implements LWG4314, for consistency with prior layouts.

The implementation uses a _PaddedStorage to deduplicate most of the code
shared between left- and right-padded layouts. It's implemented through
aggregation rather than inheritence, because of a bug related to
inheriting conditionally explicit ctors.

The tests are written such that the canonical version works for
layout_left_padded. A version for layout_right_padded is derived
essentially by reversing the order of the extents.

	PR libstdc++/110352

libstdc++-v3/ChangeLog:

	* include/bits/version.def (padded_layouts): Add new internal
	feature testing macro.
	* include/bits/version.h: Regenerate.
	* include/std/mdspan (__fwd_prod): New overload.
	(layout_left_padded): Add declaration and implementation.
	(layout_right_padded): Add declaration only.
	(layout_left::mapping::mapping): New overload for left
	padded mappings.
	(__index_type_cast): New function that performs a checked cast
	to index_type.
	(__is_left_padded_mapping): New concept.
	(__is_right_padded_mapping): Ditto.
	(__standardized_mapping): Recognize left and right padded
	mappings.
	(_LeftPaddedIndices): Traits for left padded details.
	(_PaddedStorage): New class for implementing padded layouts.
	* src/c++23/std.cc.in (layout_left_padded): Add.
	* testsuite/23_containers/mdspan/layouts/class_mandate_neg.cc:
	Refactor and add tests for layout_left_padded.
	* testsuite/23_containers/mdspan/layouts/ctors.cc: Ditto.
	* testsuite/23_containers/mdspan/layouts/empty.cc: Ditto.
	* testsuite/23_containers/mdspan/layouts/mapping.cc: Ditto.
	* testsuite/23_containers/mdspan/layouts/padded.cc: Ditto.
	* testsuite/23_containers/mdspan/layouts/padded_neg.cc: Ditto.
	* testsuite/23_containers/mdspan/layouts/padded_traits.h: New
	traits.

Reviewed-by: Tomasz Kamiński <tkaminsk@redhat.com>
Signed-off-by: Luc Grosheintz <luc.grosheintz@gmail.com>
2025-10-08 11:22:32 +02:00
2025-06-03 00:18:06 +00:00
2025-10-05 16:50:51 +00:00
2025-10-05 16:50:51 +00:00
2025-08-29 00:19:55 +00:00
2025-06-23 00:16:33 +00:00
2025-08-17 00:19:17 +00:00
2025-01-02 11:59:57 +01:00
2025-10-05 16:50:51 +00:00
2025-10-05 16:50:51 +00:00
2025-10-05 16:50:51 +00:00
2025-09-24 00:21:37 +00:00
2025-01-02 11:59:57 +01:00
2025-10-05 16:50:51 +00:00
2025-10-08 00:20:55 +00:00
2025-10-05 16:50:51 +00:00
2025-10-05 16:50:51 +00:00
2025-10-08 00:20:55 +00:00
2025-10-05 16:50:51 +00:00
2025-10-05 16:50:51 +00:00
2025-10-05 16:50:51 +00:00
2025-10-05 16:50:51 +00:00
2025-10-05 16:50:51 +00:00
2025-10-05 16:50:51 +00:00
2025-10-05 16:50:51 +00:00
2025-10-05 16:50:51 +00:00
2025-10-05 16:50:51 +00:00
2025-10-05 16:50:51 +00:00
2025-10-05 16:50:51 +00:00
2025-09-02 00:19:26 +00:00
2025-10-05 16:50:51 +00:00
2025-10-05 16:50:51 +00:00
2024-11-19 12:27:33 +01:00

This directory contains the GNU Compiler Collection (GCC).

The GNU Compiler Collection is free software.  See the files whose
names start with COPYING for copying permission.  The manuals, and
some of the runtime libraries, are under different terms; see the
individual source files for details.

The directory INSTALL contains copies of the installation information
as HTML and plain text.  The source of this information is
gcc/doc/install.texi.  The installation information includes details
of what is included in the GCC sources and what files GCC installs.

See the file gcc/doc/gcc.texi (together with other files that it
includes) for usage and porting information.  An online readable
version of the manual is in the files gcc/doc/gcc.info*.

See http://gcc.gnu.org/bugs/ for how to report bugs usefully.

Copyright years on GCC source files may be listed using range
notation, e.g., 1987-2012, indicating that every year in the range,
inclusive, is a copyrightable year that could otherwise be listed
individually.
Description
No description provided
Readme 2.7 GiB
Languages
C++ 30.7%
C 30.1%
Ada 14.4%
D 6.1%
Go 5.7%
Other 12.5%