summaryrefslogtreecommitdiff
path: root/boost/context/continuation_winfib.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'boost/context/continuation_winfib.hpp')
-rw-r--r--boost/context/continuation_winfib.hpp19
1 files changed, 14 insertions, 5 deletions
diff --git a/boost/context/continuation_winfib.hpp b/boost/context/continuation_winfib.hpp
index 5d24bbf95e..a92463f326 100644
--- a/boost/context/continuation_winfib.hpp
+++ b/boost/context/continuation_winfib.hpp
@@ -224,7 +224,7 @@ public:
try {
// invoke context-function
#if defined(BOOST_NO_CXX17_STD_INVOKE)
- c = invoke( fn_, std::move( c) );
+ c = boost::context::detail::invoke( fn_, std::move( c) );
#else
c = std::invoke( fn_, std::move( c) );
#endif
@@ -334,7 +334,11 @@ public:
return * this;
}
- continuation resume() {
+ continuation resume() & {
+ return std::move( * this).resume();
+ }
+
+ continuation resume() && {
#if defined(BOOST_NO_CXX14_STD_EXCHANGE)
detail::activation_record * ptr = detail::exchange( ptr_, nullptr)->resume();
#else
@@ -346,11 +350,16 @@ public:
ptr = detail::activation_record::current()->ontop( ptr);
detail::activation_record::current()->ontop = nullptr;
}
- return continuation{ ptr };
+ return { ptr };
+ }
+
+ template< typename Fn >
+ continuation resume_with( Fn && fn) & {
+ return std::move( * this).resume_with( std::forward< Fn >( fn) );
}
template< typename Fn >
- continuation resume_with( Fn && fn) {
+ continuation resume_with( Fn && fn) && {
#if defined(BOOST_NO_CXX14_STD_EXCHANGE)
detail::activation_record * ptr =
detail::exchange( ptr_, nullptr)->resume_with< continuation >( std::forward< Fn >( fn) );
@@ -364,7 +373,7 @@ public:
ptr = detail::activation_record::current()->ontop( ptr);
detail::activation_record::current()->ontop = nullptr;
}
- return continuation{ ptr };
+ return { ptr };
}
explicit operator bool() const noexcept {