LeechCraft  0.6.70-15082-g543737046d
Modular cross-platform feature rich live environment.
functor.h File Reference
#include <functional>
#include <optional>
#include "typeclassutil.h"
#include "void.h"
#include "either.h"
+ Include dependency graph for functor.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  LC::Util::InstanceFunctor< T >
 The Functor class is used for types that can be mapped over. More...
 
struct  LC::Util::detail::WrapVoidResult< T >
 
struct  LC::Util::detail::WrapVoidResult< void >
 
struct  LC::Util::InstanceFunctor< std::optional< T > >
 Implementation of the Functor class for std::optional. More...
 
struct  LC::Util::InstanceFunctor< Either< L, R > >
 

Namespaces

 LC
 
 LC::Util
 
 LC::Util::detail
 

Typedefs

template<typename T , typename F >
using LC::Util::FmapResult_t = typename InstanceFunctor< T >::template FmapResult_t< F >
 The result type of the contents of the functor T mapped by function F. More...
 
template<typename T >
using LC::Util::detail::WrapVoidResult_t = typename WrapVoidResult< T >::Type
 

Functions

template<typename T >
constexpr bool LC::Util::detail::IsFunctorImpl (int, typename InstanceFunctor< T >::UndefinedTag *=nullptr)
 
template<typename T >
constexpr bool LC::Util::detail::IsFunctorImpl (float)
 
template<typename T >
constexpr bool LC::Util::IsFunctor ()
 Checks whether the given type has a Functor instance for it. More...
 
template<typename T , typename F , typename = std::enable_if_t<IsFunctor<T> ()>>
FmapResult_t< T, F > LC::Util::Fmap (const T &functor, const F &function)
 Apply the function f to the elements in functor. More...
 
template<typename T , typename F >
auto LC::Util::operator* (const F &function, const T &functor) -> decltype(Fmap(functor, function))
 An operator-style alias for Fmap(). More...
 
template<typename T , typename F >
auto LC::Util::operator* (const T &functor, const F &function) -> decltype(Fmap(functor, function))
 An operator-style alias for Fmap(). More...