Chris@102: // Distributed under the Boost Software License, Version 1.0. (See Chris@102: // accompanying file LICENSE_1_0.txt or copy at Chris@102: // http://www.boost.org/LICENSE_1_0.txt) Chris@102: // (C) Copyright 2014 Vicente J. Botet Escriba Chris@102: Chris@102: #ifndef BOOST_THREAD_EXCEPTIONAL_PTR_HPP Chris@102: #define BOOST_THREAD_EXCEPTIONAL_PTR_HPP Chris@102: Chris@102: #include Chris@102: #include Chris@102: Chris@102: #include Chris@102: Chris@102: namespace boost Chris@102: { Chris@102: struct exceptional_ptr { Chris@102: exception_ptr ptr_; Chris@102: Chris@102: exceptional_ptr() : ptr_() {} Chris@102: explicit exceptional_ptr(exception_ptr ex) : ptr_(ex) {} Chris@102: template Chris@102: explicit exceptional_ptr(BOOST_FWD_REF(E) ex) : ptr_(boost::copy_exception(boost::forward(ex))) {} Chris@102: }; Chris@102: Chris@102: template Chris@102: inline exceptional_ptr make_exceptional(BOOST_FWD_REF(E) ex) { Chris@102: return exceptional_ptr(boost::forward(ex)); Chris@102: } Chris@102: Chris@102: inline exceptional_ptr make_exceptional(exception_ptr ex) Chris@102: { Chris@102: return exceptional_ptr(ex); Chris@102: } Chris@102: Chris@102: inline exceptional_ptr make_exceptional() Chris@102: { Chris@102: return exceptional_ptr(); Chris@102: } Chris@102: Chris@102: } // namespace boost Chris@102: Chris@102: #include Chris@102: Chris@102: #endif