20
20
21
21
int main (int , char **) {
22
22
using AllocVec = std::vector<bool , throwing_allocator<bool > >;
23
- try { // Throw in vector() from allocator
23
+ try { // Throw in vector() from allocator
24
24
AllocVec vec; // Throw on default construction
25
25
} catch (int ) {
26
26
}
27
27
check_new_delete_called ();
28
28
29
- #if TEST_STD_VER >= 14
30
- try { // Throw in vector(size_type, const allocator_type&) from allocator
29
+ #if TEST_STD_VER >= 14
30
+ try { // Throw in vector(size_type, const allocator_type&) from allocator
31
31
throwing_allocator<bool > alloc (false , true ); // Throw on copy only
32
32
AllocVec get_alloc (0 , alloc);
33
33
} catch (int ) {
34
34
}
35
35
check_new_delete_called ();
36
- #endif // TEST_STD_VER >= 14
36
+ #endif // TEST_STD_VER >= 14
37
37
38
38
try { // Throw in vector(size_type, const value_type&, const allocator_type&) from allocator
39
39
throwing_allocator<bool > alloc (false , true ); // Throw on copy only
@@ -43,34 +43,40 @@ int main(int, char**) {
43
43
check_new_delete_called ();
44
44
45
45
try { // Throw in vector(InputIterator, InputIterator) from input iterator
46
- std::vector<bool > vec ((throwing_iterator<bool , std::input_iterator_tag>()), throwing_iterator<bool , std::input_iterator_tag>(2 ));
46
+ std::vector<bool > vec (
47
+ (throwing_iterator<bool , std::input_iterator_tag>()), throwing_iterator<bool , std::input_iterator_tag>(2 ));
47
48
} catch (int ) {
48
49
}
49
50
check_new_delete_called ();
50
51
51
52
try { // Throw in vector(InputIterator, InputIterator) from forward iterator
52
- std::vector<bool > vec ((throwing_iterator<bool , std::forward_iterator_tag>()), throwing_iterator<bool , std::forward_iterator_tag>(2 ));
53
+ std::vector<bool > vec (
54
+ (throwing_iterator<bool , std::forward_iterator_tag>()), throwing_iterator<bool , std::forward_iterator_tag>(2 ));
53
55
} catch (int ) {
54
56
}
55
57
check_new_delete_called ();
56
58
57
59
try { // Throw in vector(InputIterator, InputIterator) from allocator
58
60
bool a[] = {true , true };
59
- AllocVec vec (cpp17_input_iterator<bool *>(a), cpp17_input_iterator<bool *>(a + 2 )); // throwing_allocator throws on default construction
61
+ AllocVec vec (cpp17_input_iterator<bool *>(a),
62
+ cpp17_input_iterator<bool *>(a + 2 )); // throwing_allocator throws on default construction
60
63
} catch (int ) {
61
64
}
62
65
check_new_delete_called ();
63
66
64
67
try { // Throw in vector(InputIterator, InputIterator, const allocator_type&) from input iterator
65
68
std::allocator<bool > alloc;
66
- std::vector<bool > vec (throwing_iterator<bool , std::input_iterator_tag>(), throwing_iterator<bool , std::input_iterator_tag>(2 ), alloc);
69
+ std::vector<bool > vec (
70
+ throwing_iterator<bool , std::input_iterator_tag>(), throwing_iterator<bool , std::input_iterator_tag>(2 ), alloc);
67
71
} catch (int ) {
68
72
}
69
73
check_new_delete_called ();
70
74
71
75
try { // Throw in vector(InputIterator, InputIterator, const allocator_type&) from forward iterator
72
76
std::allocator<bool > alloc;
73
- std::vector<bool > vec (throwing_iterator<bool , std::forward_iterator_tag>(), throwing_iterator<bool , std::forward_iterator_tag>(2 ), alloc);
77
+ std::vector<bool > vec (throwing_iterator<bool , std::forward_iterator_tag>(),
78
+ throwing_iterator<bool , std::forward_iterator_tag>(2 ),
79
+ alloc);
74
80
} catch (int ) {
75
81
}
76
82
check_new_delete_called ();
@@ -79,7 +85,7 @@ int main(int, char**) {
79
85
bool a[] = {true , true };
80
86
throwing_allocator<bool > alloc (false , true ); // Throw on copy only
81
87
AllocVec vec (cpp17_input_iterator<bool *>(a), cpp17_input_iterator<bool *>(a + 2 ), alloc);
82
- } catch (int ) {
88
+ } catch (int ) {
83
89
}
84
90
check_new_delete_called ();
85
91
0 commit comments