MCPcopy Create free account
hub / github.com/NVIDIA/stdexec / throwing_move

Class throwing_move

test/stdexec/algos/factories/test_just.cpp:163–183  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

161 TEST_CASE("just works with types with throwing move", "[factories][just]")
162 {
163 struct throwing_move
164 {
165 explicit throwing_move(std::size_t& throws_after) noexcept
166 : throws_after_(throws_after)
167 {}
168
169 throwing_move(throwing_move&& other) // NOLINT(bugprone-exception-escape)
170 : throws_after_(other.throws_after_)
171 {
172 if (throws_after_)
173 {
174 --throws_after_;
175 }
176 else
177 {
178 throw std::runtime_error("Throwing as requested");
179 }
180 }
181 private:
182 std::size_t& throws_after_;
183 };
184
185 std::size_t throws_after = 0;
186 auto const repeat_until_succeeds = [&](auto f) noexcept -> decltype(auto)

Callers 1

test_just.cppFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected