1 // Distributed under the Boost Software License, Version 1.0. (See
2 // accompanying file LICENSE_1_0.txt or copy at
3 // http://www.boost.org/LICENSE_1_0.txt)
4 // (C) Copyright 2014 Vicente J. Botet Escriba
6 #ifndef BOOST_THREAD_EXCEPTIONAL_PTR_HPP
7 #define BOOST_THREAD_EXCEPTIONAL_PTR_HPP
9 #include <boost/thread/detail/move.hpp>
10 #include <boost/exception_ptr.hpp>
12 #include <boost/config/abi_prefix.hpp>
16 struct exceptional_ptr {
19 exceptional_ptr() : ptr_() {}
20 explicit exceptional_ptr(exception_ptr ex) : ptr_(ex) {}
22 explicit exceptional_ptr(BOOST_FWD_REF(E) ex) : ptr_(boost::copy_exception(boost::forward<E>(ex))) {}
26 inline exceptional_ptr make_exceptional(BOOST_FWD_REF(E) ex) {
27 return exceptional_ptr(boost::forward<E>(ex));
30 inline exceptional_ptr make_exceptional(exception_ptr ex)
32 return exceptional_ptr(ex);
35 inline exceptional_ptr make_exceptional()
37 return exceptional_ptr();
42 #include <boost/config/abi_suffix.hpp>