};
struct forced_unwind {
- activation_record * from{ nullptr };
+ activation_record * from{ nullptr };
+#ifndef BOOST_ASSERT_IS_VOID
+ bool caught{ false };
+#endif
forced_unwind( activation_record * from_) noexcept :
from{ from_ } {
}
+
+#ifndef BOOST_ASSERT_IS_VOID
+ ~forced_unwind() {
+ BOOST_ASSERT( caught);
+ }
+#endif
};
template< typename Ctx, typename StackAlloc, typename Fn >
#endif
} catch ( forced_unwind const& ex) {
c = Ctx{ ex.from };
+#ifndef BOOST_ASSERT_IS_VOID
+ const_cast< forced_unwind & >( ex).caught = true;
+#endif
}
// this context has finished its task
from = nullptr;
reinterpret_cast< uintptr_t >( sctx.sp) - static_cast< uintptr_t >( sctx.size) );
// create user-context
if ( BOOST_UNLIKELY( 0 != ::getcontext( & record->uctx) ) ) {
+ record->~capture_t();
+ salloc.deallocate( sctx);
throw std::system_error(
std::error_code( errno, std::system_category() ),
"getcontext() failed");
reinterpret_cast< uintptr_t >( palloc.sctx.sp) - static_cast< uintptr_t >( palloc.sctx.size) );
// create user-context
if ( BOOST_UNLIKELY( 0 != ::getcontext( & record->uctx) ) ) {
+ record->~capture_t();
+ salloc.deallocate( palloc.sctx);
throw std::system_error(
std::error_code( errno, std::system_category() ),
"getcontext() failed");
return nullptr == ptr_ || ptr_->terminated;
}
- bool operator==( continuation const& other) const noexcept {
- return ptr_ == other.ptr_;
- }
-
- bool operator!=( continuation const& other) const noexcept {
- return ptr_ != other.ptr_;
- }
-
bool operator<( continuation const& other) const noexcept {
return ptr_ < other.ptr_;
}
- bool operator>( continuation const& other) const noexcept {
- return other.ptr_ < ptr_;
- }
-
- bool operator<=( continuation const& other) const noexcept {
- return ! ( * this > other);
- }
-
- bool operator>=( continuation const& other) const noexcept {
- return ! ( * this < other);
- }
-
template< typename charT, class traitsT >
friend std::basic_ostream< charT, traitsT > &
operator<<( std::basic_ostream< charT, traitsT > & os, continuation const& other) {