@@ -3,27 +3,27 @@ <h1>Parallel exceptions</h1>
3
3
< cxx-section id ="parallel.exceptions.behavior ">
4
4
< h1 > Exception reporting behavior</ h1 >
5
5
< p >
6
- During the execution of a standard parallel algorithm,
7
- if temporary memory resources are required and none are available,
6
+ < ins2 > During the execution of a standard parallel algorithm, </ ins2 >
7
+ < del2 > I </ del2 > < ins2 > i </ ins2 > f temporary memory resources are required < del2 > by the algorithm </ del2 > and none are available,
8
8
the algorithm throws a < code > std::bad_alloc</ code > exception.
9
9
</ p >
10
10
< p >
11
- During the execution of a standard parallel algorithm, if the < del > application of a function
12
- object</ del > < ins > invocation of an element access function</ ins > terminates with an uncaught
11
+ During the execution of a standard parallel algorithm, if the < del3 > application of a function
12
+ object</ del3 > < ins3 > invocation of an element access function</ ins > terminates with an uncaught
13
13
exception, the behavior of the program is determined by the type of execution policy used to
14
14
invoke the algorithm:
15
15
16
16
< ul >
17
17
< li >
18
- If the execution policy object is of type < code > class parallel_vector_execution_policy</ code > ,
18
+ If the execution policy object is of type < code > class < del2 > vector_execution_policy </ del2 > < ins2 > parallel_vector_execution_policy</ ins2 > </ code > ,
19
19
< code > std::terminate</ code > shall be called.
20
20
</ li >
21
21
< li >
22
22
If the execution policy object is of type < code > sequential_execution_policy</ code > or
23
23
< code > parallel_execution_policy</ code > , the execution of the algorithm terminates with an
24
24
< code > exception_list</ code > exception. All uncaught exceptions thrown during
25
- the < del > application of user-provided function objects</ del > < ins > invocations of element access functions </ ins >
26
- shall be contained in the < code > exception_list</ code > .< pre >
25
+ the < del3 > application of user-provided function objects</ del3 > < ins3 > invocations of element
26
+ access functions </ ins3 > shall be contained in the < code > exception_list</ code > .< pre >
27
27
</ pre >
28
28
29
29
< cxx-note >
@@ -60,28 +60,41 @@ <h1>Header <code><experimental/exception_list></code> synopsis</h1>
60
60
namespace std {
61
61
namespace experimental {
62
62
namespace parallel {
63
- inline namespace v1 {
63
+ < ins2 > inline namespace v1 {</ ins2 >
64
64
65
65
class exception_list : public exception
66
66
{
67
67
public:
68
- typedef < em > unspecified</ em > iterator;
68
+ < del2 >
69
+ typedef exception_ptr value_type;
70
+ typedef const value_type& reference;
71
+ typedef const value_type& const_reference;
72
+ typedef < em > implementation-defined</ em > const_iterator;
73
+ typedef const_iterator iterator;
74
+ typedef typename iterator_traits< ins2 > <const_iterator></ ins2 > ::difference_type difference_type;
75
+ typedef size_t size_type;</ del2 >
76
+ < ins2 >
77
+ typedef < em > unspecified</ em > iterator;</ ins2 >
69
78
70
79
size_t size() const noexcept;
71
80
iterator begin() const noexcept;
72
81
iterator end() const noexcept;
73
82
74
- const char* what() const override noexcept;
83
+ < ins2 > const char* what() const noexcept override;</ ins2 >
84
+ < del2 >
85
+ private:
86
+ std::list<exception_ptr> exceptions_; // exposition only
87
+ </ del2 >
75
88
};
76
- }
89
+ < ins2 > } </ ins2 >
77
90
}
78
91
}
79
92
}
80
93
</ pre >
81
94
82
95
< p >
83
- The class < code > exception_list</ code > owns a sequence of < code > exception_ptr</ code > objects. The parallel
84
- algorithms may use the < code > exception_list</ code > to communicate uncaught exceptions encountered during parallel execution to the
96
+ The class < code > exception_list</ code > < del2 > is a container </ del2 > < ins2 > owns a sequence</ ins2 > of < code > exception_ptr</ code > objects < ins2 > . The</ ins2 > parallel
97
+ algorithms may use < ins2 > the < code > exception_list</ code > </ ins2 > to communicate uncaught exceptions encountered during parallel execution to the
85
98
caller of the algorithm.
86
99
</ p >
87
100
@@ -106,7 +119,7 @@ <h1>Header <code><experimental/exception_list></code> synopsis</h1>
106
119
107
120
< cxx-function >
108
121
< cxx-signature >
109
- iterator begin() const noexcept;
122
+ < del2 > exception_list:: </ del2 > iterator begin() const noexcept;
110
123
</ cxx-signature >
111
124
112
125
< cxx-returns >
@@ -116,21 +129,21 @@ <h1>Header <code><experimental/exception_list></code> synopsis</h1>
116
129
117
130
< cxx-function >
118
131
< cxx-signature >
119
- iterator end() const noexcept;
132
+ < del2 > exception_list:: </ del2 > iterator end() const noexcept;
120
133
</ cxx-signature >
121
134
122
135
< cxx-returns >
123
- An iterator that is past the end of the owned sequence.
136
+ An iterator < del2 > which is the past-the-end value for the < code > exception_list </ code > </ del2 > < ins2 > that is past the end of the owned sequence.</ ins2 >
124
137
</ cxx-returns >
125
138
</ cxx-function >
126
139
127
140
< cxx-function >
128
141
< cxx-signature >
129
- const char* what() const noexcept override;
142
+ < ins2 > const char* what() const noexcept override;</ ins2 >
130
143
</ cxx-signature >
131
144
132
145
< cxx-returns >
133
- An implementation-defined NTBS.
146
+ < ins2 > An implementation-defined NTBS.</ ins2 >
134
147
</ cxx-returns >
135
148
</ cxx-function >
136
149
</ cxx-section >
0 commit comments