Provide reasonable default definition for is_contiguous#4731
Open
user202729 wants to merge 1 commit intofmtlib:mainfrom
Open
Provide reasonable default definition for is_contiguous#4731user202729 wants to merge 1 commit intofmtlib:mainfrom
user202729 wants to merge 1 commit intofmtlib:mainfrom
Conversation
8b0fd20 to
c9a57d4
Compare
c9a57d4 to
5f956f9
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Another attempt at #4716 . Compiling
base-test.cctakes around 10 seconds (both before and after), probably is fine. (not sure what else to measure.)Instead of using
contiguous_iterator, I just check whether.data()can be called on it; if it can be called, the container is likely contiguous. Opinion?Some code assumes that if it's contiguous,
.resize()exists, so it won't work for e.g.std::arrayeven though that one is contiguous. But thenback_insert_iteratordoesn't work onstd::arrayeither.Directly define a partial specialization of
is_contiguouswithtypename = voidleads to ambiguous overload errors, which is backwards incompatible if someone else special-caseis_contiguous. See for example https://github.com/user202729/fmt/actions/runs/24015836992/job/70035092887