Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix a few small bugs in submdspan #6621

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

crtrott
Copy link
Contributor

@crtrott crtrott commented Oct 13, 2023

This fixes a couple bugs in subdmspan. Some of the wording for constraints/mandates/preconditions of submdspan_extents was straight copied from submdspan_mapping but the names of the things it refers to are not quite right (src is actually the equivalent of extents() and decltype(src) the equivalent of Extents). Also fixes the last precondition in submdspan_mapping which should be essentially the same as in submdspan_extents i.e. a strict ordering of the values, not comparing to 0 each of them.

@@ -21741,11 +21741,11 @@
\begin{itemdescr}
\pnum
\constraints
\tcode{sizeof...(slices)} equals \tcode{Extents::rank()}.
\tcode{sizeof...(slices)} equals \tcode{decltype(src)::rank()}.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

decltype(src) is const extents<IndexType, Extents...>&and reference types don't have members, so this is ill-formed.src.rank()would work here, as wouldextents<IndexType, Extents...>::rank()`. (I think the latter is more conventional for the Standard Library, though I have no data to back that up nor strong feelings either way.)

\hphantom{0 } \le \tcode{extents().extent($k$)}$
$0 \le \tcode{\exposid{first_}<index_type, $k$>(slices...)}$
$\le \tcode{\exposid{last_}<$k$>(extents(), slices...)}$
$\le \tcode{extents().extent($k$)}$
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FWIW, I didn't read this before as comparing each expression to 0, but as chained comparisons as you intend. In either case, you this line is now overlong and needs to be broken manually (hence the CI failure).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason you're changing the linebreaking here? Is there non-whitespace change here that you want to make?

@tkoeppe
Copy link
Contributor

tkoeppe commented Nov 8, 2023

Please get in touch and we can figure this out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants