mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-07-31 07:12:01 +08:00
Merge branch 'tm_fix_static_map_build'
This commit is contained in:
commit
f83abb09dc
@ -258,8 +258,14 @@ public:
|
||||
// e.g.: auto map = make_staticmap<const char*, int>({ {"one", 1}, {"two", 2}})
|
||||
// will work, and only the key and value type needs to be specified. No need
|
||||
// to state the number of elements, that is deduced automatically.
|
||||
template<class K, class V, size_t N, class Cmp = DefaultCmp<K, V>>
|
||||
constexpr auto make_staticmap(const SMapEl<K, V> (&arr) [N], Cmp cmp = {})
|
||||
template<class K, class V, size_t N>
|
||||
constexpr auto make_staticmap(const SMapEl<K, V> (&arr) [N])
|
||||
{
|
||||
return StaticMap<K, V, N>{static_set_detail ::to_array(arr), DefaultCmp<K, V>{}};
|
||||
}
|
||||
|
||||
template<class K, class V, size_t N, class Cmp>
|
||||
constexpr auto make_staticmap(const SMapEl<K, V> (&arr) [N], Cmp cmp)
|
||||
{
|
||||
return StaticMap<K, V, N, Cmp>{static_set_detail ::to_array(arr), cmp};
|
||||
}
|
||||
|
@ -42,7 +42,7 @@ add_executable(${_TEST_NAME}_tests
|
||||
test_support_spots_generator.cpp
|
||||
../data/prusaparts.cpp
|
||||
../data/prusaparts.hpp
|
||||
# test_static_map.cpp
|
||||
test_static_map.cpp
|
||||
)
|
||||
|
||||
if (TARGET OpenVDB::openvdb)
|
||||
|
@ -61,7 +61,7 @@ TEST_CASE("StaticMap should derive it's type using make_staticmap", "[StaticMap]
|
||||
for (auto &[k, v] : ciManyMap) {
|
||||
auto val = query(ciManyMap, k);
|
||||
REQUIRE(val.has_value());
|
||||
REQUIRE(val.value() == v);
|
||||
REQUIRE(*val == v);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user