From 68c018fda69d3bae685b815a64203ff58e010272 Mon Sep 17 00:00:00 2001 From: Christian Mazakas Date: Tue, 18 Apr 2023 12:30:34 -0700 Subject: [PATCH] Clean up usage of decltype to help msvc-14.3 --- test/cfoa/visit_tests.cpp | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/test/cfoa/visit_tests.cpp b/test/cfoa/visit_tests.cpp index 1f18562a..4c22782c 100644 --- a/test/cfoa/visit_tests.cpp +++ b/test/cfoa/visit_tests.cpp @@ -380,6 +380,9 @@ namespace { void empty_visit(X*, G gen, test::random_generator rg) { auto values = make_random_values(1024 * 16, [&] { return gen(rg); }); + using values_type = decltype(values); + using span_value_type = typename values_type::value_type; + raii::reset_counts(); { @@ -392,20 +395,19 @@ namespace { std::uint64_t old_move_assignment = raii::move_assignment; { - thread_runner( - values, [&x](boost::span s) { - std::atomic num_visits{0}; + thread_runner(values, [&x](boost::span s) { + std::atomic num_visits{0}; - x.visit_all( + x.visit_all( + [&num_visits](typename X::value_type const&) { ++num_visits; }); + BOOST_TEST_EQ(num_visits, 0u); + + for (auto const& val : s) { + auto count = x.visit(val.first, [&num_visits](typename X::value_type const&) { ++num_visits; }); - BOOST_TEST_EQ(num_visits, 0u); - - for (auto const& val : s) { - auto count = x.visit(val.first, - [&num_visits](typename X::value_type const&) { ++num_visits; }); - BOOST_TEST_EQ(count, 0u); - } - }); + BOOST_TEST_EQ(count, 0u); + } + }); } BOOST_TEST_EQ(old_default_constructor, raii::default_constructor);