45 lines
1.1 KiB
C++
45 lines
1.1 KiB
C++
// Distributed under the Boost Software License, Version 1.0. (See
|
|
// accompanying file LICENSE_1_0.txt or copy at
|
|
// http://www.boost.org/LICENSE_1_0.txt)
|
|
// (C) Copyright 2014 Vicente J. Botet Escriba
|
|
|
|
#ifndef ACTIV_BOOST_THREAD_EXCEPTIONAL_PTR_HPP
|
|
#define ACTIV_BOOST_THREAD_EXCEPTIONAL_PTR_HPP
|
|
|
|
#include <ActivBoost/thread/detail/move.hpp>
|
|
#include <ActivBoost/exception_ptr.hpp>
|
|
|
|
#include <ActivBoost/config/abi_prefix.hpp>
|
|
|
|
namespace Boost
|
|
{
|
|
struct exceptional_ptr {
|
|
exception_ptr ptr_;
|
|
|
|
exceptional_ptr() : ptr_() {}
|
|
explicit exceptional_ptr(exception_ptr ex) : ptr_(ex) {}
|
|
template <class E>
|
|
explicit exceptional_ptr(ACTIV_BOOST_FWD_REF(E) ex) : ptr_(Boost::copy_exception(Boost::forward<E>(ex))) {}
|
|
};
|
|
|
|
template <class E>
|
|
inline exceptional_ptr make_exceptional(ACTIV_BOOST_FWD_REF(E) ex) {
|
|
return exceptional_ptr(Boost::forward<E>(ex));
|
|
}
|
|
|
|
inline exceptional_ptr make_exceptional(exception_ptr ex)
|
|
{
|
|
return exceptional_ptr(ex);
|
|
}
|
|
|
|
inline exceptional_ptr make_exceptional()
|
|
{
|
|
return exceptional_ptr();
|
|
}
|
|
|
|
} // namespace Boost
|
|
|
|
#include <ActivBoost/config/abi_suffix.hpp>
|
|
|
|
#endif
|