1234567891011121314151617181920212223242526272829303132333435 |
- #ifndef BOOST_COBALT_EXPERIMENTAL_FRAME_HPP
- #define BOOST_COBALT_EXPERIMENTAL_FRAME_HPP
- #include <type_traits>
- #include <utility>
- namespace boost::cobalt::experimental
- {
- template<typename Impl, typename Promise>
- struct frame
- {
- void (*resume_) (frame *) = +[](frame * ff) { static_cast<Impl*>(ff)->resume();};
- void (*destroy_)(frame *) = +[](frame * ff) { static_cast<Impl*>(ff)->destroy();};
- typedef Promise promise_type;
- Promise promise;
- template<typename ... Args>
- frame(Args && ... args) : promise(std::forward<Args>(args)...)
- {
- }
- };
- }
- #endif
|