minilua::CallResult class

Result of calling a lua Function.

Contains the actual return value (actually a Vallist) and optionally source changes.

Supports equality operators.

Constructors, destructors, conversion operators

CallResult()
Creates a CallResult with a Nil value and no source changes.
CallResult(Vallist)
Creates a CallResult from a Vallist and no source changes.
CallResult(std::vector<Value>)
Creates a CallResult from multiple values and no source changes.
CallResult(std::initializer_list<Value>) explicit
Creates a CallResult from multiple values and no source changes.
CallResult(SourceChangeTree) explicit
Creates a CallResult with a Nil value and the given source changes.
CallResult(std::optional<SourceChangeTree>) explicit
Creates a CallResult with a Nil value and the given optional source changes.
CallResult(Vallist, SourceChangeTree) explicit
Creates a CallResult with the given values and the given source changes.
CallResult(Vallist, std::optional<SourceChangeTree>) explicit
Creates a CallResult with the given values and the given optional source changes.

Public functions

auto values() const -> const Vallist & -> auto
Get the return values.
auto source_change() const -> const std::optional< SourceChangeTree > & -> auto
Get the source change.
auto one_value() const -> CallResult -> auto
Truncate the CallResult to max one value.
auto combine(const CallResult& other) const -> CallResult -> auto
Combines two CallResults.

Function documentation

auto minilua::CallResult::combine(const CallResult& other) const -> CallResult

Combines two CallResults.

Takes the value of the given call result (other) and combines the source changes.