Closed dchansen closed 4 months ago
The channel class requires that the value type be copyable, so things like unique_ptrs cannot be used with it.
This example (for instance) does not compile:
#include <boost/cobalt.hpp> #include <any> #include <memory> namespace bc = boost::cobalt; struct OnlyOne { OnlyOne() = default; OnlyOne(const OnlyOne&) = delete; OnlyOne( OnlyOne&&) = default; }; bc::task<void> test(){ bc::channel<OnlyOne> c; co_await c.write(OnlyOne()); }
See godbolt
Thanks for reporting. I created fixes for both your issues, can you check if they fix all problems?
Thanks for the quick response. Your patch fixed both issues.
The channel class requires that the value type be copyable, so things like unique_ptrs cannot be used with it.
This example (for instance) does not compile:
See godbolt