Krita Source Code Documentation
Loading...
Searching...
No Matches
KisZug.h File Reference
#include <QtGlobal>
#include <type_traits>
#include "KisMpl.h"
#include <zug/transducer/map.hpp>
#include <zug/reducing/last.hpp>

Go to the source code of this file.

Classes

struct  kiszug::empty_t
 

Namespaces

namespace  kiszug
 

Variables

constexpr auto kiszug::foreach_arg
 
constexpr auto kiszug::foreach_tuple
 
template<typename T >
constexpr auto kiszug::map_equal = [] (T value) { return zug::map([value](auto&& x) { return x == value; }); }
 
template<>
constexpr auto kiszug::map_equal< qreal > = [] (qreal value) { return zug::map([value](auto&& x) { return qFuzzyCompare(x, value); }); }
 
template<typename T >
constexpr auto kiszug::map_greater = [] (T value) { return zug::map([value](auto&& x) { return x > value; }); }
 
template<typename T >
constexpr auto kiszug::map_greater_equal = [] (T value) { return zug::map([value](auto&& x) { return x >= value; }); }
 
template<>
constexpr auto kiszug::map_greater_equal< qreal > = [] (qreal value) { return zug::map([value](auto&& x) { return x >= value || qFuzzyCompare(x, value); }); }
 
template<typename T >
constexpr auto kiszug::map_less = [] (T value) { return zug::map([value](auto&& x) { return x < value; }); }
 
template<typename T >
constexpr auto kiszug::map_less_equal = [] (T value) { return zug::map([value](auto&& x) { return x <= value; }); }
 
template<>
constexpr auto kiszug::map_less_equal< qreal > = [] (qreal value) { return zug::map([value](auto&& x) { return x <= value || qFuzzyCompare(x, value); }); }
 
template<typename T >
constexpr auto kiszug::map_multiply = [] (T coeff) { return zug::map([coeff](auto&& x) { return x * coeff; }); }
 
template<typename T >
constexpr auto kiszug::map_not_equal = [] (T value) { return zug::map([value](auto&& x) { return x != value; }); }
 
template<>
constexpr auto kiszug::map_not_equal< qreal > = [] (qreal value) { return zug::map([value](auto&& x) { return !qFuzzyCompare(x, value); }); }
 
constexpr auto kiszug::map_round = zug::map([](qreal x) -> int { return qRound(x); })
 
template<typename T >
constexpr auto kiszug::map_static_cast = zug::map([](auto&& x) { return static_cast<T>(x); })
 
constexpr auto kiszug::to_functor