|
Krita Source Code Documentation
|
Namespaces | |
| namespace | detail |
Classes | |
| struct | finally |
| struct | first_type |
| struct | overloaded |
Typedefs | |
| template<typename... T> | |
| using | first_type_t = typename first_type<T...>::type |
| template<std::size_t Num> | |
| using | make_index_sequence_from_1 |
Functions | |
| template<typename F , typename Tuple > | |
| auto | apply_to_tuple (F f, Tuple &&t) |
| template<typename Fun , typename... Args, typename T = typename first_type_t<std::remove_reference_t<Args>...>::value_type> | |
| std::optional< T > | fold_optional (Fun &&fun, Args &&...args) |
| std::future< void > | make_ready_future () |
| template<typename T > | |
| std::future< std::decay_t< T > > | make_ready_future (T &&value) |
| template<typename Class , typename MemType , typename MemTypeNoRef = std::remove_reference_t<MemType>> | |
| auto | mem_equal_to (MemTypeNoRef Class::*ptr, MemType &&value) |
| mem_equal_to is an unary functor that compares a member of the object to a given value | |
| template<typename Class , typename MemType , typename MemTypeNoRef = std::remove_reference_t<MemType>> | |
| auto | mem_equal_to (MemTypeNoRef(Class::*ptr)() noexcept, MemType &&value) |
| template<typename Class , typename MemType , typename MemTypeNoRef = std::remove_reference_t<MemType>> | |
| auto | mem_equal_to (MemTypeNoRef(Class::*ptr)(), MemType &&value) |
| template<typename Class , typename MemType > | |
| auto | mem_greater (MemType Class::*ptr) |
| mem_greater is a binary functor that compares a member of the object to a given value or two objects based on the value of their members | |
| template<typename Class , typename MemType > | |
| auto | mem_greater (MemType(Class::*ptr)() noexcept) |
| template<typename Class , typename MemType > | |
| auto | mem_greater (MemType(Class::*ptr)()) |
| template<typename Class , typename MemType , typename MemTypeNoRef = std::remove_reference_t<MemType>> | |
| auto | mem_greater (MemTypeNoRef Class::*ptr, MemType &&value) |
| mem_greater is an unary functor that compares a member of the object to a given value | |
| template<typename Class , typename MemType , typename MemTypeNoRef = std::remove_reference_t<MemType>> | |
| auto | mem_greater (MemTypeNoRef(Class::*ptr)() noexcept, MemType &&value) |
| template<typename Class , typename MemType , typename MemTypeNoRef = std::remove_reference_t<MemType>> | |
| auto | mem_greater (MemTypeNoRef(Class::*ptr)(), MemType &&value) |
| template<typename Class , typename MemType > | |
| auto | mem_greater_equal (MemType Class::*ptr) |
| mem_greater_equal is a binary functor that compares a member of the object to a given value or two objects based on the value of their members | |
| template<typename Class , typename MemType > | |
| auto | mem_greater_equal (MemType(Class::*ptr)() noexcept) |
| template<typename Class , typename MemType > | |
| auto | mem_greater_equal (MemType(Class::*ptr)()) |
| template<typename Class , typename MemType , typename MemTypeNoRef = std::remove_reference_t<MemType>> | |
| auto | mem_greater_equal (MemTypeNoRef Class::*ptr, MemType &&value) |
| mem_greater_equal is an unary functor that compares a member of the object to a given value | |
| template<typename Class , typename MemType , typename MemTypeNoRef = std::remove_reference_t<MemType>> | |
| auto | mem_greater_equal (MemTypeNoRef(Class::*ptr)() noexcept, MemType &&value) |
| template<typename Class , typename MemType , typename MemTypeNoRef = std::remove_reference_t<MemType>> | |
| auto | mem_greater_equal (MemTypeNoRef(Class::*ptr)(), MemType &&value) |
| template<typename Class , typename MemType > | |
| auto | mem_less (MemType Class::*ptr) |
| mem_less is a binary functor that compares a member of the object to a given value or two objects based on the value of their members | |
| template<typename Class , typename MemType > | |
| auto | mem_less (MemType(Class::*ptr)() noexcept) |
| template<typename Class , typename MemType > | |
| auto | mem_less (MemType(Class::*ptr)()) |
| template<typename Class , typename MemType , typename MemTypeNoRef = std::remove_reference_t<MemType>> | |
| auto | mem_less (MemTypeNoRef Class::*ptr, MemType &&value) |
| mem_less is an unary functor that compares a member of the object to a given value | |
| template<typename Class , typename MemType , typename MemTypeNoRef = std::remove_reference_t<MemType>> | |
| auto | mem_less (MemTypeNoRef(Class::*ptr)() noexcept, MemType &&value) |
| template<typename Class , typename MemType , typename MemTypeNoRef = std::remove_reference_t<MemType>> | |
| auto | mem_less (MemTypeNoRef(Class::*ptr)(), MemType &&value) |
| template<typename Class , typename MemType > | |
| auto | mem_less_equal (MemType Class::*ptr) |
| mem_less_equal is a binary functor that compares a member of the object to a given value or two objects based on the value of their members | |
| template<typename Class , typename MemType > | |
| auto | mem_less_equal (MemType(Class::*ptr)() noexcept) |
| template<typename Class , typename MemType > | |
| auto | mem_less_equal (MemType(Class::*ptr)()) |
| template<typename Class , typename MemType , typename MemTypeNoRef = std::remove_reference_t<MemType>> | |
| auto | mem_less_equal (MemTypeNoRef Class::*ptr, MemType &&value) |
| mem_less_equal is an unary functor that compares a member of the object to a given value | |
| template<typename Class , typename MemType , typename MemTypeNoRef = std::remove_reference_t<MemType>> | |
| auto | mem_less_equal (MemTypeNoRef(Class::*ptr)() noexcept, MemType &&value) |
| template<typename Class , typename MemType , typename MemTypeNoRef = std::remove_reference_t<MemType>> | |
| auto | mem_less_equal (MemTypeNoRef(Class::*ptr)(), MemType &&value) |
| template<class... Ts> | |
| overloaded (Ts...) -> overloaded< Ts... > | |
| template<class T , class Function > | |
| auto | then (std::future< T > &&future, Function &&func) -> std::future< decltype(func(std::move(future)))> |
Variables | |
| constexpr auto | unzip_wrapper |
'kismpl' stands for kis-meta-program-library
| using kismpl::first_type_t = typename first_type<T...>::type |
| using kismpl::make_index_sequence_from_1 |
| auto kismpl::apply_to_tuple | ( | F | f, |
| Tuple && | t ) |
Apply a given functor F to each element of the tuple and return a tuple consisting of the resulting values.
Definition at line 60 of file KisMpl.h.
References kismpl::detail::apply_to_tuple_impl(), and value().
| std::optional< T > kismpl::fold_optional | ( | Fun && | fun, |
| Args &&... | args ) |
Folds all the valid optional values using the binary function fun into one optional value. When none optional values are present, an empty optional of the specified type is returned.
Definition at line 137 of file KisMpl.h.
References kismpl::detail::fold_optional_impl< Fun, T >::fold().
| std::future< void > kismpl::make_ready_future | ( | ) |
Definition at line 24 of file KisFutureUtils.h.
| std::future< std::decay_t< T > > kismpl::make_ready_future | ( | T && | value | ) |
Create a future whose value has already been evaluated
See rejected C++ proposal for details: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3721.pdf
Definition at line 18 of file KisFutureUtils.h.
References value().
|
inline |
mem_equal_to is an unary functor that compares a member of the object to a given value
The functor is supposed to be used in std::find_if and other standard algorithms. It can automatically dereference a pointer-to-member or a pointer-to-method.
\code{.cpp}
struct Struct {
Struct (int _id) : id(_id) {}
int id = -1;
int idConstFunc() const {
return id;
}
};
std::vector<Struct> vec({{0},{1},{2},{3}});
// find an element, which has member 'id' set to 1
auto it1 = std::find_if(vec.begin(), vec.end(), kismpl::mem_equal_to(&Struct::id, 1));
// find an element, whose member function 'idConstFunc()' returns 1
auto it2 = std::find_if(vec.begin(), vec.end(), kismpl::mem_equal_to(&Struct::idConstFunc, 1));
// the functor can automatically dereference pointers and shared pointers
std::vector<std::shared_ptr<Struct>> vec({std::make_shared<Struct>(0),
std::make_shared<Struct>(1),
std::make_shared<Struct>(2),
std::make_shared<Struct>(3),
std::make_shared<Struct>(4)});
// the shared pointer is automatically lifted by the functor
auto it3 = std::find_if(vec.begin(), vec.end(), kismpl::mem_equal_to(&Struct::id, 1));
\endcode
Definition at line 233 of file KisMpl.h.
References value().
|
inline |
Definition at line 251 of file KisMpl.h.
References value().
|
inline |
Definition at line 239 of file KisMpl.h.
References value().
|
inline |
mem_greater is a binary functor that compares a member of the object to a given value or two objects based on the value of their members
|
inline |
|
inline |
|
inline |
mem_greater is an unary functor that compares a member of the object to a given value
Definition at line 341 of file KisMpl.h.
References value().
|
inline |
Definition at line 359 of file KisMpl.h.
References value().
|
inline |
Definition at line 347 of file KisMpl.h.
References value().
|
inline |
|
inline |
|
inline |
|
inline |
mem_greater_equal is an unary functor that compares a member of the object to a given value
Definition at line 378 of file KisMpl.h.
References value().
|
inline |
Definition at line 396 of file KisMpl.h.
References value().
|
inline |
Definition at line 384 of file KisMpl.h.
References value().
|
inline |
mem_less is a binary functor that compares a member of the object to a given value or two objects based on the value of their members
The functor is supposed to be used in std::lower_bound and other standard algorithms. It can automatically dereference a pointer-to-member or a pointer-to-method.
\code{.cpp}
struct Struct {
Struct (int _id) : id(_id) {}
int id = -1;
int idConstFunc() const {
return id;
}
};
std::vector<Struct> vec({{0},{1},{2},{3}});
// find the first element, whose 'id' is not less than 1
auto it1 = std::lower_bound(vec.begin(), vec.end(), 1, kismpl::mem_less(&Struct::id));
// find the first element, whose 'id' returned by 'idConstFunc()' is not less than 1
auto it2 = std::lower_bound(vec.begin(), vec.end(), 1, kismpl::mem_less(&Struct::idConstFunc, 1));
// the functor can automatically dereference pointers and shared pointers
std::vector<std::shared_ptr<Struct>> vec({std::make_shared<Struct>(0),
std::make_shared<Struct>(1),
std::make_shared<Struct>(2),
std::make_shared<Struct>(3),
std::make_shared<Struct>(4)});
// the shared pointer is automatically lifted by the functor
auto it3 = std::lower_bound(vec.begin(), vec.end(), 1, kismpl::mem_less(&Struct::id));
\endcode
|
inline |
|
inline |
|
inline |
mem_less is an unary functor that compares a member of the object to a given value
Definition at line 269 of file KisMpl.h.
References value().
|
inline |
Definition at line 287 of file KisMpl.h.
References value().
|
inline |
Definition at line 275 of file KisMpl.h.
References value().
|
inline |
mem_less_equal is a binary functor that compares a member of the object to a given value or two objects based on the value of their members
|
inline |
|
inline |
|
inline |
mem_less_equal is an unary functor that compares a member of the object to a given value
Definition at line 305 of file KisMpl.h.
References value().
|
inline |
Definition at line 323 of file KisMpl.h.
References value().
|
inline |
Definition at line 311 of file KisMpl.h.
References value().
| kismpl::overloaded | ( | Ts... | ) | -> overloaded< Ts... > |
| auto kismpl::then | ( | std::future< T > && | future, |
| Function && | func ) -> std::future<decltype(func(std::move(future)))> |
Execute a given function func when the provided future future is completed. The future is not deferefenced outside the passed function to avoid spilling the exceptions.
See rejected C++ proposal for details: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3721.pdf
Definition at line 40 of file KisFutureUtils.h.
|
constexpr |
Convert a given functor f accepting multiple arguments into a function that accepts a tuple with the same number of elements
Definition at line 70 of file KisMpl.h.