|
Krita Source Code Documentation
|
Namespaces | |
| namespace | lenses |
Functions | |
| template<typename Func , typename... Cursors, typename FirstCursor = typename kismpl::first_type_t<std::remove_reference_t<Cursors>...>::value_type, typename T = typename FirstCursor::value_type> | |
| std::optional< lager::reader< T > > | fold_optional_cursors (const Func &func, Cursors &&...cursors) |
| std::optional< lager::reader< T > > kislager::fold_optional_cursors | ( | const Func & | func, |
| Cursors &&... | cursors ) |
Fold all valid optional cursors from a set into one by using func
Example:
std::optional<lager::reader<int>> brushSize1 = ...; std::optional<lager::reader<int>> brushSize2 = ...;
std::optional<lager::reader<int>> maxSize = fold_optional_cursors(&std::max, brushSize1, brushSize2);
The resulting reader 'maxSize' will hold the maximum value of the two brushes, or nothing if the source readers do not exist.
Definition at line 37 of file KisLager.h.
References kismpl::fold_optional().