From f87db33ec178a7594c73394ccc852f0f8203ba56 Mon Sep 17 00:00:00 2001 From: DerThorsten Date: Sat, 16 Nov 2024 12:24:23 +0100 Subject: [PATCH] options --- include/sparrow/builder/builder.hpp | 2 +- include/sparrow/utils/mp_utils.hpp | 2 +- src/array_factory.cpp | 1 - test/test_builder.cpp | 19 ++++++++++++++++--- 4 files changed, 18 insertions(+), 6 deletions(-) diff --git a/include/sparrow/builder/builder.hpp b/include/sparrow/builder/builder.hpp index fe540ace7..6495d4883 100644 --- a/include/sparrow/builder/builder.hpp +++ b/include/sparrow/builder/builder.hpp @@ -57,7 +57,7 @@ inline constexpr large_binary_flag_t large_binary_flag; template auto build(T&& t, OPTION_FLAGS&& ... ) { - using option_flags_type = sparrow::mpl::typelist; + using option_flags_type = sparrow::mpl::typelist...>; return detail::builder::create(std::forward(t)); } diff --git a/include/sparrow/utils/mp_utils.hpp b/include/sparrow/utils/mp_utils.hpp index bfff98fc1..bf8baf176 100644 --- a/include/sparrow/utils/mp_utils.hpp +++ b/include/sparrow/utils/mp_utils.hpp @@ -238,7 +238,7 @@ namespace sparrow::mpl /// `false` otherwise or if the list is empty. template class L, class... T> requires any_typelist> and (callable_type_predicate && ...) - consteval bool any_of(L, Predicate predicate = {}) + consteval bool any_of(L, [[maybe_unused]] Predicate predicate = {}) { return (evaluate(predicate) || ... || false); } diff --git a/src/array_factory.cpp b/src/array_factory.cpp index 10bb08e72..2103704f1 100644 --- a/src/array_factory.cpp +++ b/src/array_factory.cpp @@ -13,7 +13,6 @@ // limitations under the License. #include - #include "sparrow/array_factory.hpp" #include "sparrow/layout/list_layout/list_array.hpp" #include "sparrow/layout/struct_layout/struct_array.hpp" diff --git a/test/test_builder.cpp b/test/test_builder.cpp index ee3968010..f392b4ee2 100644 --- a/test/test_builder.cpp +++ b/test/test_builder.cpp @@ -89,10 +89,23 @@ namespace sparrow }; sanity_check(sparrow::build(v)); } - SUBCASE("large-list") + SUBCASE("options") { - std::vector> v{{1.0f, 2.0f, 3.0f}, {4.0f, 5.0f}}; - auto arr = sparrow::build(v, sparrow::large_list_flag); + SUBCASE("with_large_list_flag") + { + std::vector> v{{1.0f, 2.0f, 3.0f}, {4.0f, 5.0f}}; + auto arr = sparrow::build(v, sparrow::large_list_flag); + using array_type = std::decay_t; + static_assert(std::is_same_v); + } + SUBCASE("without_large_list_flag") + { + std::vector> v{{1.0f, 2.0f, 3.0f}, {4.0f, 5.0f}}; + auto arr = sparrow::build(v); + using array_type = std::decay_t; + static_assert(std::is_same_v); + } + } } TEST_CASE("struct-layout")