Fix C++17 build of WeakPartialOrderingTest - #32
Open
arthaud wants to merge 1 commit into
Open
Conversation
`std::to_array` is only available from C++20 onwards, but the project
pins C++17 (CMAKE_CXX_STANDARD in cmake_modules/Commons.cmake), so the
test failed to compile:
error: 'to_array' is not a member of 'std'
None of the library headers use any C++20 feature, so make the test
match the standard the rest of the project targets rather than raising
it. `lst` is only ever read through `lst[i++]`, so a `std::vector`
initializer is a drop-in replacement at all 15 call sites.
Drop the now-unused <array> include and add <vector>, which the file
already relied on transitively.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DA9pVcgt8MxaeGJUaYfh5H
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.
std::to_arrayis only available from C++20 onwards, but the project pins C++17 (CMAKE_CXX_STANDARD in cmake_modules/Commons.cmake), so the test failed to compile:None of the library headers use any C++20 feature, so make the test match the standard the rest of the project targets rather than raising it.
lstis only ever read throughlst[i++], so astd::vectorinitializer is a drop-in replacement at all 15 call sites.Drop the now-unused include and add , which the file already relied on transitively.