LeechCraft  0.6.70-15082-g543737046d
Modular cross-platform feature rich live environment.
LC::Util::InstanceFunctor< T > Struct Template Reference

The Functor class is used for types that can be mapped over. More...

#include "functor.h"

Public Types

using UndefinedTag = void
 
template<typename F >
using FmapResult_t = detail::ImplementationType
 The type of the functor after its elements were mapped by the function F. More...
 

Static Public Member Functions

template<typename F >
static FmapResult_t< F > Apply (const T &functor, const F &function)
 Applies the function to the each of the elements inside the functor. More...
 

Detailed Description

template<typename T>
struct LC::Util::InstanceFunctor< T >

The Functor class is used for types that can be mapped over.

Minimal complete definition:

  • Apply() function and FmapResult_t alias.

For a reference imolementation please see InstanceFunctor<std::optional<T>>.

Template Parameters
TThe functor type instantiated with some concrete containee type.
See also
Fmap()
IsFunctor()

Definition at line 47 of file functor.h.

Member Typedef Documentation

◆ FmapResult_t

template<typename T >
template<typename F >
using LC::Util::InstanceFunctor< T >::FmapResult_t = detail::ImplementationType

The type of the functor after its elements were mapped by the function F.

This type should correspond to the return type of the Apply() function when passed this functor and a function of type F.

Template Parameters
FThe type of the function to apply to the elements inside this functor.

Definition at line 68 of file functor.h.

◆ UndefinedTag

template<typename T >
using LC::Util::InstanceFunctor< T >::UndefinedTag = void

Definition at line 55 of file functor.h.

Member Function Documentation

◆ Apply()

template<typename T >
template<typename F >
static FmapResult_t<F> LC::Util::InstanceFunctor< T >::Apply ( const T &  functor,
const F &  function 
)
static

Applies the function to the each of the elements inside the functor.

Parameters
[in]functorThe functor whose values are subject to function.
[in]functionThe function that should be applied to the values in the functor.
Returns
A functor of type FmapResult_t<F> where each element the result of applying the function to the corresponding element in the source functor.
Template Parameters
FThe type of the function to apply to the elements in the function.

Referenced by LC::Util::IsFunctor().

+ Here is the caller graph for this function:

The documentation for this struct was generated from the following file: