MayaFlux 0.4.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ get_or_else()

template<typename Executor , ComputeData DataType>
template<typename Generator >
requires std::invocable<Generator>
DataType MayaFlux::Yantra::FluentExecutor< Executor, DataType >::get_or_else ( Generator &&  generator) const
inline

Return the raw result or invoke a generator if the chain failed.

Template Parameters
GeneratorCallable type: () -> DataType
Parameters
generatorInvoked to produce a fallback when the chain failed
Returns
Processed DataType or result of generator

Definition at line 469 of file OperationChain.hpp.

470 {
471 return m_successful ? m_data.data : std::forward<Generator>(generator)();
472 }
T data
The actual computation data.
Definition DataIO.hpp:25