Skip to content

Commit

Permalink
options
Browse files Browse the repository at this point in the history
  • Loading branch information
DerThorsten committed Nov 16, 2024
1 parent c9e1aed commit f87db33
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 6 deletions.
2 changes: 1 addition & 1 deletion include/sparrow/builder/builder.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ inline constexpr large_binary_flag_t large_binary_flag;
template<class T, class ... OPTION_FLAGS>
auto build(T&& t, OPTION_FLAGS&& ... )
{
using option_flags_type = sparrow::mpl::typelist<OPTION_FLAGS...>;
using option_flags_type = sparrow::mpl::typelist<std::decay_t<OPTION_FLAGS>...>;
return detail::builder<T, option_flags_type>::create(std::forward<T>(t));
}

Expand Down
2 changes: 1 addition & 1 deletion include/sparrow/utils/mp_utils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ namespace sparrow::mpl
/// `false` otherwise or if the list is empty.
template <class Predicate, template <class...> class L, class... T>
requires any_typelist<L<T...>> and (callable_type_predicate<Predicate, T> && ...)
consteval bool any_of(L<T...>, Predicate predicate = {})
consteval bool any_of(L<T...>, [[maybe_unused]] Predicate predicate = {})
{
return (evaluate<T>(predicate) || ... || false);
}
Expand Down
1 change: 0 additions & 1 deletion src/array_factory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
// limitations under the License.

#include <memory>

#include "sparrow/array_factory.hpp"
#include "sparrow/layout/list_layout/list_array.hpp"
#include "sparrow/layout/struct_layout/struct_array.hpp"
Expand Down
19 changes: 16 additions & 3 deletions test/test_builder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,23 @@ namespace sparrow
};
sanity_check(sparrow::build(v));
}
SUBCASE("large-list")
SUBCASE("options")
{
std::vector<std::vector<float>> 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<std::vector<float>> 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<decltype(arr)>;
static_assert(std::is_same_v<array_type, sparrow::big_list_array>);
}
SUBCASE("without_large_list_flag")
{
std::vector<std::vector<float>> v{{1.0f, 2.0f, 3.0f}, {4.0f, 5.0f}};
auto arr = sparrow::build(v);
using array_type = std::decay_t<decltype(arr)>;
static_assert(std::is_same_v<array_type, sparrow::list_array>);
}

}
}
TEST_CASE("struct-layout")
Expand Down

0 comments on commit f87db33

Please sign in to comment.