operator + method
Instruction<MemoryCell<T> , Pulse, Pulse>
operator +(
- covariant Instruction<
Cell, Pulse, Pulse> other
override
Combines this instruction with another to create an InstructionChain.
When to use
This is the most idiomatic and readable way to compose multiple
instructions. Use it to fluently build a sequential processing pipeline
without the verbosity of the Instruction.chain factory.
How it works
- It creates an
InstructionChainwherethisinstruction is executed first. - The output of
thisis passed as the input to theotherinstruction. - The resulting chain is itself an
Instruction, allowing for continuous, multi-stage composition.
Parameters:
other: The instruction to append to the processing chain.
Returns:
A new InstructionChain containing both instructions.
Example
final pipeline = trim + validate + persist;
Implementation
@override
Instruction<MemoryCell<T>, Pulse, Pulse> operator +(
covariant Instruction other) =>
_body + other;