-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c3996b8
commit 9e26ad2
Showing
4 changed files
with
126 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
//===----------------------------------------------------------------------===// | ||
// | ||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
// See https://llvm.org/LICENSE.txt for license information. | ||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
// | ||
//===----------------------------------------------------------------------===// | ||
// | ||
// Modified for https://github.com/morzhovets/momo project. | ||
// | ||
//===----------------------------------------------------------------------===// | ||
|
||
// UNSUPPORTED: c++03, c++11, c++14, c++17, c++20 | ||
// Some fields in the test case variables are deliberately not explicitly initialized, this silences a warning on GCC. | ||
// ADDITIONAL_COMPILE_FLAGS(gcc-style-warnings): -Wno-missing-field-initializers | ||
|
||
// <set> | ||
|
||
// template<container-compatible-range<value_type> R> | ||
// void insert_range(R&& rg); // C++23 | ||
|
||
int main(int, char**) { | ||
for_all_iterators_and_allocators<int, const int*>([]<class Iter, class Sent, class Alloc>() { | ||
test_map_set_insert_range<std::multiset<int, test_less<int>, Alloc>, int, Iter, Sent>(/*allow_duplicates=*/true); | ||
}); | ||
|
||
static_assert(test_set_constraints_insert_range<std::multiset, int, double>()); | ||
|
||
test_set_insert_range_move_only<std::multiset>(); | ||
|
||
test_set_insert_range_exception_safety_throwing_copy<std::multiset>(); | ||
test_assoc_set_insert_range_exception_safety_throwing_allocator<std::multiset, int>(); | ||
|
||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
test/sources/libcxx/multiset/multiset.cons/from_range.pass.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
//===----------------------------------------------------------------------===// | ||
// | ||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
// See https://llvm.org/LICENSE.txt for license information. | ||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
// | ||
//===----------------------------------------------------------------------===// | ||
// | ||
// Modified for https://github.com/morzhovets/momo project. | ||
// | ||
//===----------------------------------------------------------------------===// | ||
|
||
// UNSUPPORTED: c++03, c++11, c++14, c++17, c++20 | ||
|
||
// template<container-compatible-range<value_type> R> | ||
// multiset(from_range_t, R&& rg, const Compare& comp = Compare(), const Allocator& = Allocator()); // C++23 | ||
// | ||
// template<container-compatible-range<value_type> R> | ||
// multiset(from_range_t, R&& rg, const Allocator& a)) | ||
// : multiset(from_range, std::forward<R>(rg), Compare(), a) { } // C++23 | ||
|
||
void test_duplicates() { | ||
std::array input = {1, 2, 3, 3, 3, 4, 2, 1, 2}; | ||
auto c = std::multiset<int>(std::from_range, input); | ||
assert(std::ranges::is_permutation(input, c)); | ||
} | ||
|
||
int main(int, char**) { | ||
for_all_iterators_and_allocators<int>([]<class Iter, class Sent, class Alloc>() { | ||
test_associative_set<std::multiset, int, Iter, Sent, test_less<int>, Alloc>(); | ||
}); | ||
test_associative_set_move_only<std::multiset>(); | ||
test_duplicates(); | ||
|
||
static_assert(test_set_constraints<std::multiset, int, double>()); | ||
|
||
test_set_exception_safety_throwing_copy<std::multiset>(); | ||
test_set_exception_safety_throwing_allocator<std::multiset, int>(); | ||
|
||
return 0; | ||
} |