LeechCraft 0.6.70-17609-g3dde4097dd
Modular cross-platform feature rich live environment.
Loading...
Searching...
No Matches
LC::Util::InstanceFunctor< std::optional< T > > Struct Template Reference

Implementation of the Functor class for std::optional. More...

#include "functor.h"

Inheritance diagram for LC::Util::InstanceFunctor< std::optional< T > >:
Collaboration diagram for LC::Util::InstanceFunctor< std::optional< T > >:

Public Types

template<typename F>
using FmapResult_t = std::optional<detail::WrapVoidResult_t<std::decay_t<std::invoke_result_t<F, T>>>>
using UndefinedTag

Static Public Member Functions

template<typename F>
static FmapResult_t< F > Apply (const std::optional< T > &t, const F &f)

Detailed Description

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

Implementation of the Functor class for std::optional.

The implementation applies the function to the contents of the std::optional if it's not empty, otherwise it just leaves an empty std::optional.

This is analogous to the Maybe type.

Template Parameters
TThe element type contained inside the std::optional.

Definition at line 214 of file functor.h.

Member Typedef Documentation

◆ FmapResult_t

template<typename T>
template<typename F>
using LC::Util::InstanceFunctor< std::optional< T > >::FmapResult_t = std::optional<detail::WrapVoidResult_t<std::decay_t<std::invoke_result_t<F, T>>>>

Definition at line 217 of file functor.h.

◆ UndefinedTag

using LC::Util::InstanceFunctor< T >::UndefinedTag

Definition at line 37 of file functor.h.

Member Function Documentation

◆ Apply()

template<typename T>
template<typename F>
FmapResult_t< F > LC::Util::InstanceFunctor< std::optional< T > >::Apply ( const std::optional< T > & t,
const F & f )
inlinestatic

Definition at line 220 of file functor.h.


The documentation for this struct was generated from the following file:
  • /home/abuild/rpmbuild/BUILD/leechcraft-doc-0.6.70+git.17609.g3dde4097dd-build/leechcraft-0.6.70-17609-g3dde4097dd/src/util/sll/functor.h