tools:cplusplus
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
tools:cplusplus [2017/09/24 15:31] – created graf | tools:cplusplus [2021/07/08 19:31] (current) – [Lambda Functions] ursgraf | ||
---|---|---|---|
Line 49: | Line 49: | ||
The square brackets - even if left empty - are necessary, because a '' | The square brackets - even if left empty - are necessary, because a '' | ||
Do not forget to call the method '' | Do not forget to call the method '' | ||
+ | |||
+ | ===== Lambda Functions ===== | ||
+ | A lambda is an anonymous function which can be passed as a parameter. While using EEROS lambda functions are useful for several cases. | ||
+ | * Safety system: see [[eeros_architecture: | ||
+ | * Function used by periodic: see [[tools: | ||
+ | * Generic block: see [[eeros_architecture: | ||
+ | |||
+ | A lambda function must be defined as follows | ||
+ | <code cpp> | ||
+ | [captures] (params) {body} | ||
+ | </ | ||
+ | Captures are variables which are defined in the scope where the lambda function is defined and which can be made available to the lambda function either by value or by reference. Params are parameters which can be passed into the function like regular parameters. The body contains the code which is executed by the function. | ||
+ | |||
+ |
tools/cplusplus.1506259875.txt.gz · Last modified: 2017/09/24 15:31 (external edit)