3636#pragma warning(disable: 4127) // conditional expression is constant
3737#endif
3838
39- namespace boost
40- {
4139template <typename T>
4240struct wrap
4341{
@@ -47,9 +45,8 @@ struct wrap
4745};
4846
4947template <typename T>
50- exception_ptr make_exception_ptr (T v) {
51- return copy_exception (wrap<T>(v));
52- }
48+ boost::exception_ptr make_exception_ptr (T v) {
49+ return boost::copy_exception (wrap<T>(v));
5350}
5451
5552void func1 (boost::promise<int > p)
@@ -61,7 +58,7 @@ void func1(boost::promise<int> p)
6158void func2 (boost::promise<int > p)
6259{
6360 boost::this_thread::sleep_for (boost::chrono::milliseconds (500 ));
64- p.set_exception (boost ::make_exception_ptr (3 ));
61+ p.set_exception (::make_exception_ptr (3 ));
6562}
6663
6764int j = 0 ;
@@ -76,7 +73,7 @@ void func3(boost::promise<int&> p)
7673void func4 (boost::promise<int &> p)
7774{
7875 boost::this_thread::sleep_for (boost::chrono::milliseconds (500 ));
79- p.set_exception (boost ::make_exception_ptr (3.5 ));
76+ p.set_exception (::make_exception_ptr (3.5 ));
8077}
8178
8279void func5 (boost::promise<void > p)
@@ -88,7 +85,7 @@ void func5(boost::promise<void> p)
8885void func6 (boost::promise<void > p)
8986{
9087 boost::this_thread::sleep_for (boost::chrono::milliseconds (500 ));
91- p.set_exception (boost ::make_exception_ptr (4 ));
88+ p.set_exception (::make_exception_ptr (4 ));
9289}
9390
9491
@@ -120,7 +117,7 @@ int main()
120117#if defined BOOST_THREAD_PROVIDES_SIGNATURE_PACKAGED_TASK && defined(BOOST_THREAD_PROVIDES_VARIADIC_THREAD)
121118 boost::thread (func2, boost::move (p)).detach ();
122119#else
123- p.set_exception (boost ::make_exception_ptr (3 ));
120+ p.set_exception (::make_exception_ptr (3 ));
124121#endif
125122 BOOST_THREAD_LOG << BOOST_THREAD_END_LOG;
126123 try
@@ -133,7 +130,7 @@ int main()
133130 BOOST_TEST (false );
134131 BOOST_THREAD_LOG << BOOST_THREAD_END_LOG;
135132 }
136- catch (boost ::wrap<int > const & i)
133+ catch (::wrap<int > const & i)
137134 {
138135 BOOST_THREAD_LOG << BOOST_THREAD_END_LOG;
139136 BOOST_TEST (i.value == 3 );
@@ -177,15 +174,15 @@ int main()
177174#if defined BOOST_THREAD_PROVIDES_SIGNATURE_PACKAGED_TASK && defined(BOOST_THREAD_PROVIDES_VARIADIC_THREAD)
178175 boost::thread (func4, boost::move (p)).detach ();
179176#else
180- p.set_exception (boost ::make_exception_ptr (3.5 ));
177+ p.set_exception (::make_exception_ptr (3.5 ));
181178#endif
182179 try
183180 {
184181 BOOST_TEST (f.valid ());
185182 BOOST_TEST (f.get () == 3 );
186183 BOOST_TEST (false );
187184 }
188- catch (boost ::wrap<double > const & i)
185+ catch (::wrap<double > const & i)
189186 {
190187 BOOST_TEST (i.value == 3.5 );
191188 }
@@ -200,7 +197,7 @@ int main()
200197#if defined BOOST_THREAD_PROVIDES_SIGNATURE_PACKAGED_TASK && defined(BOOST_THREAD_PROVIDES_VARIADIC_THREAD)
201198 boost::thread (func4, boost::move (p)).detach ();
202199#else
203- p.set_exception (boost ::make_exception_ptr (3.5 ));
200+ p.set_exception (::make_exception_ptr (3.5 ));
204201#endif
205202 try
206203 {
@@ -238,15 +235,15 @@ int main()
238235#if defined BOOST_THREAD_PROVIDES_SIGNATURE_PACKAGED_TASK && defined(BOOST_THREAD_PROVIDES_VARIADIC_THREAD)
239236 boost::thread (func6, boost::move (p)).detach ();
240237#else
241- p.set_exception (boost ::make_exception_ptr (4 ));
238+ p.set_exception (::make_exception_ptr (4 ));
242239#endif
243240 try
244241 {
245242 BOOST_TEST (f.valid ());
246243 f.get ();
247244 BOOST_TEST (false );
248245 }
249- catch (boost ::wrap<int > const & i)
246+ catch (::wrap<int > const & i)
250247 {
251248 BOOST_TEST (i.value == 4 );
252249 }
0 commit comments