add ctors from sorted ranges optimization

This commit is contained in:
2019-05-31 08:52:32 +07:00
parent 8104ebd598
commit 8fe5c749ff
8 changed files with 295 additions and 133 deletions

View File

@@ -186,6 +186,15 @@ TEST_CASE("flat_set") {
s3 = {1,2,3};
REQUIRE(s3 == set_t{1,2,3});
}
{
auto s0 = set_t(sorted_unique_range, {1,2,3});
REQUIRE(s0 == set_t{1,2,3});
vec_t v1({1,2,3});
auto s1 = set_t(sorted_unique_range, v1.begin(), v1.end());
REQUIRE(s1 == set_t{1,2,3});
}
}
SECTION("capacity") {
using set_t = flat_set<int>;