mirror of
https://github.com/BlackMATov/flat.hpp.git
synced 2025-12-13 01:36:27 +07:00
add default ctor noexcept
This commit is contained in:
@@ -73,7 +73,8 @@ namespace
|
||||
template < typename T >
|
||||
class dummy_less {
|
||||
public:
|
||||
dummy_less(int i) : i(i) {}
|
||||
dummy_less() = default;
|
||||
dummy_less(int i) noexcept : i(i) {}
|
||||
bool operator()(const T& l, const T& r) const {
|
||||
return l < r;
|
||||
}
|
||||
@@ -95,6 +96,20 @@ TEST_CASE("flat_multimap") {
|
||||
};
|
||||
REQUIRE(sizeof(vc) == sizeof(int));
|
||||
}
|
||||
SECTION("noexcept") {
|
||||
using alloc_t = dummy_allocator<std::pair<int,unsigned>>;
|
||||
using map_t = flat_multimap<int, unsigned, dummy_less<int>, std::vector<std::pair<int,unsigned>, alloc_t>>;
|
||||
|
||||
static_assert(
|
||||
std::is_nothrow_default_constructible<map_t>::value,
|
||||
"unit test static error");
|
||||
static_assert(
|
||||
std::is_nothrow_move_constructible<map_t>::value,
|
||||
"unit test static error");
|
||||
static_assert(
|
||||
std::is_nothrow_move_assignable<map_t>::value,
|
||||
"unit test static error");
|
||||
}
|
||||
SECTION("types") {
|
||||
using map_t = flat_multimap<int, unsigned>;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user