1#ifndef CREATE_CONTRACT_H
2#define CREATE_CONTRACT_H
25 [[nodiscard]]
virtual std::any create(
const args &a,
randomizer &rng)
noexcept = 0;
32 static_assert(std::is_same_v<T, std::decay_t<T>>,
"T must be a plain value type");
33 static_assert(std::is_copy_constructible_v<T>,
"std::any requires copy-constructible results");
35 auto result = create(a, rng);
36 if (
auto *value = std::any_cast<T>(&result))
38 return std::move(*value);
Command-line argument handler with JSON support.
Definition args.h:19
Contract for the create function in the runtime.
Definition create_contract.h:21
std::optional< T > create_as(const args &a, randomizer &rng) noexcept
Calls create and extracts the result as T.
Definition create_contract.h:30
Provides random-number generating capabilities.
Definition randomizer.h:16