Re: [PATCH v2 1/5] libstdc++: Check prerequisites of layout_*::operator().

2025-07-03 Thread Luc Grosheintz
On 7/3/25 12:45, Jonathan Wakely wrote: On Thu, 3 Jul 2025 at 11:12, Tomasz Kaminski wrote: On Thu, Jul 3, 2025 at 12:08 PM Luc Grosheintz wrote: The reasoning for this approach was: 1. The mapping::operator() and mdspan::operator[] have the same precondition; and mdspan::operator[

Re: [PATCH v2 1/5] libstdc++: Check prerequisites of layout_*::operator().

2025-07-03 Thread Jonathan Wakely
On Thu, 3 Jul 2025 at 11:12, Tomasz Kaminski wrote: > > > > On Thu, Jul 3, 2025 at 12:08 PM Luc Grosheintz > wrote: >> >> >> >> On 7/1/25 22:56, Jonathan Wakely wrote: >> > On Tue, 1 Jul 2025 at 11:32, Tomasz Kaminski wrote: >> >> >> >> Hi, >> >> More of the review will be later, but I have not

Re: [PATCH v2 1/5] libstdc++: Check prerequisites of layout_*::operator().

2025-07-03 Thread Tomasz Kaminski
On Thu, Jul 3, 2025 at 12:08 PM Luc Grosheintz wrote: > > > On 7/1/25 22:56, Jonathan Wakely wrote: > > On Tue, 1 Jul 2025 at 11:32, Tomasz Kaminski > wrote: > >> > >> Hi, > >> More of the review will be later, but I have noticed that you have > added preconditions checks > >> to the layouts, an

Re: [PATCH v2 1/5] libstdc++: Check prerequisites of layout_*::operator().

2025-07-03 Thread Luc Grosheintz
On 7/1/25 22:56, Jonathan Wakely wrote: On Tue, 1 Jul 2025 at 11:32, Tomasz Kaminski wrote: Hi, More of the review will be later, but I have noticed that you have added preconditions checks to the layouts, and then avoid checking them inside the operator[] of the mdspan. This is general s

Re: [PATCH v2 1/5] libstdc++: Check prerequisites of layout_*::operator().

2025-07-01 Thread Jonathan Wakely
On Tue, 1 Jul 2025 at 11:32, Tomasz Kaminski wrote: > > Hi, > More of the review will be later, but I have noticed that you have added > preconditions checks > to the layouts, and then avoid checking them inside the operator[] of the > mdspan. This is general > sounds good. > > However, the prec

Re: [PATCH v2 1/5] libstdc++: Check prerequisites of layout_*::operator().

2025-07-01 Thread Luc Grosheintz
On 7/1/25 12:30, Tomasz Kaminski wrote: Hi, More of the review will be later, but I have noticed that you have added preconditions checks to the layouts, and then avoid checking them inside the operator[] of the mdspan. This is general sounds good. However, the precondition on mdspan::operator

Re: [PATCH v2 1/5] libstdc++: Check prerequisites of layout_*::operator().

2025-07-01 Thread Tomasz Kaminski
Hi, More of the review will be later, but I have noticed that you have added preconditions checks to the layouts, and then avoid checking them inside the operator[] of the mdspan. This is general sounds good. However, the precondition on mdspan::operator[] is now hardened: https://eel.is/c++draft/

[PATCH v2 1/5] libstdc++: Check prerequisites of layout_*::operator().

2025-06-27 Thread Luc Grosheintz
Previously the prerequisite that the arguments passed to operator() are a multi-dimensional index (of extents()) was not checked. This commit adds the __glibcxx_asserts and the required tests. libstdc++-v3/ChangeLog: * include/std/mdspan: Check prerequisites of layout_*::operator