forced_unwind.hpp 765 B

12345678910111213141516171819202122232425262728293031323334353637
  1. // Copyright Oliver Kowalke 2014.
  2. // Distributed under the Boost Software License, Version 1.0.
  3. // (See accompanying file LICENSE_1_0.txt or copy at
  4. // http://www.boost.org/LICENSE_1_0.txt)
  5. #ifndef BOOST_COROUTINES2_DETAIL_FORCED_UNWIND_HPP
  6. #define BOOST_COROUTINES2_DETAIL_FORCED_UNWIND_HPP
  7. #include <exception>
  8. #include <boost/assert.hpp>
  9. #include <boost/config.hpp>
  10. #ifdef BOOST_HAS_ABI_HEADERS
  11. # include BOOST_ABI_PREFIX
  12. #endif
  13. namespace boost {
  14. namespace coroutines2 {
  15. namespace detail {
  16. struct forced_unwind {};
  17. inline
  18. void * unwind_coroutine( void * data) {
  19. throw forced_unwind{};
  20. return data;
  21. }
  22. }}}
  23. #ifdef BOOST_HAS_ABI_HEADERS
  24. # include BOOST_ABI_SUFFIX
  25. #endif
  26. #endif // BOOST_COROUTINES2_DETAIL_FORCED_UNWIND_HPP