};
struct forced_unwind {
- activation_record * from{ nullptr };
+ activation_record * from{ nullptr };
+#ifndef BOOST_ASSERT_IS_VOID
+ bool caught{ false };
+#endif
explicit forced_unwind( activation_record * from_) :
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;
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) {