Hegel 0.11.4
Property-based testing for C++
Loading...
Searching...
No Matches
hegel::Worker< T > Class Template Reference

Handle to a worker started by TestCase::spawn(). More...

#include <test_case.h>

Public Member Functions

 Worker (Worker &&) noexcept=default
 Move-constructs, transferring ownership of the running worker.
 Worker (const Worker &)=delete
Workeroperator= (const Worker &)=delete
join ()
 Await the worker and return its result.

Detailed Description

template<typename T>
class hegel::Worker< T >

Handle to a worker started by TestCase::spawn().

Move-only. join() awaits the worker and returns its result, re-raising any exception it threw. The destructor joins if join() was never called.

Member Function Documentation

◆ join()

template<typename T>
T hegel::Worker< T >::join ( )
inline

Await the worker and return its result.

Re-raises any exception thrown on the worker thread. Call at most once, before the test body returns.

Returns
The value returned by the spawned callable.

The documentation for this class was generated from the following file: