Closed endseeker closed 4 years ago
Did you try to move the vector into when_all
?
Continuable follows strict move on invalidation semantics and thus the copy constructor and copy assign operator is deleted.
cti::when_all(std::move(v))
.then([](std::vector<int> resolved) {
// ...
});
yes, std::move(v) works.
Perfect, was the code without the move somewhere in the documentation and needs a correction?
yes, its here toward the bottom: https://naios.github.io/continuable/tutorial-connecting-continuables.html
@Naios
this code from "Connecting continuables" dosnt compile under Visual studio 2019. error is "attempting to reference a deleted function". I think you are missing a std::move() when calling cti::when_all()
// cti::populate just creates a std::vector from the two continuables. auto v = cti::populate(cti::make_ready_continuable(0), cti::make_ready_continuable(1));
for (int i = 2; i < 5; ++i) { // It is possible to add more continuables // to the container afterwards container.emplace_back(cti::make_ready_continuable(i)); }
cti::when_all(v) .then([](std::vector resolved) {
// ...
});
Commit Hash
{Please write here}
Expected Behavior
{Please write here}
Actual Behavior
{Please write here}
Steps to Reproduce
{Please write here}
Your Environment