1
0
mirror of https://github.com/CLIUtils/CLI11.git synced 2025-04-30 12:43:52 +00:00

fixi: include windows 2022 (#748)

* ci: include windows 2022

* fix visual studio 2022 issue with std::array and type detection

* style: pre-commit.ci fixes

* warning fixes

Co-authored-by: Philip Top <top1@llnl.gov>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Philip Top <phlptp@gmail.com>
This commit is contained in:
Henry Schreiner 2022-09-05 23:51:15 -04:00 committed by GitHub
parent e88700a6da
commit 1a26afab04
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 4 deletions

View File

@ -57,10 +57,14 @@ jobs:
Windows11:
vmImage: "windows-2019"
cli11.std: 11
WindowsLatest:
vmImage: "windows-2019"
Windows20:
vmImage: "windows-2022"
cli11.std: 20
cli11.options: -DCMAKE_CXX_FLAGS="/std:c++latest /EHsc"
cli11.options: -DCMAKE_CXX_FLAGS="/EHsc"
WindowsLatest:
vmImage: "windows-2022"
cli11.std: 23
cli11.options: -DCMAKE_CXX_FLAGS="/EHsc"
Linux17nortti:
vmImage: "ubuntu-latest"
cli11.std: 17

View File

@ -655,7 +655,8 @@ struct classify_object<
typename std::enable_if<is_tuple_like<T>::value &&
((type_count<T>::value >= 2 && !is_wrapper<T>::value) ||
(uncommon_type<T>::value && !is_direct_constructible<T, double>::value &&
!is_direct_constructible<T, int>::value))>::type> {
!is_direct_constructible<T, int>::value) ||
(uncommon_type<T>::value && type_count<T>::value >= 2))>::type> {
static constexpr object_category value{object_category::tuple_value};
// the condition on this class requires it be like a tuple, but on some compilers (like Xcode) tuples can be
// constructed from just the first element so tuples of <string, int,int> can be constructed from a string, which

View File

@ -1228,6 +1228,8 @@ TEST_CASE("Types: LexicalConversionTuple3", "[helpers]") {
TEST_CASE("Types: LexicalConversionTuple4", "[helpers]") {
CLI::results_t input = {"9.12", "19", "18.6", "5.87"};
std::array<double, 4> x;
auto tsize = CLI::detail::type_count<decltype(x)>::value;
CHECK(tsize == 4);
bool res = CLI::detail::lexical_conversion<decltype(x), decltype(x)>(input, x);
CHECK(res);
CHECK(19 == Approx(std::get<1>(x)));