Function map

Summary

#include <toml/result.hpp>

(1) template <typename F>
    result< detail::return_type_of_t< F, value_type & >, error_type > map(F &&f) &

(2) template <typename F>
    result< detail::return_type_of_t< F, value_type const  & >, error_type > map(F &&f) const &

(3) template <typename F>
    result< detail::return_type_of_t< F, value_type && >, error_type > map(F &&f) &&

Function overload

Synopsis

#include <toml/result.hpp>

template <typename F>
result< detail::return_type_of_t< F, value_type & >, error_type > map(F &&f) &

Description

No description yet.

Mentioned in

Source

Lines 463-469 in toml/result.hpp.

template<typename F>
result<detail::return_type_of_t<F, value_type&>, error_type>
map(F&& f) &
{
    if(this->is_ok()){return ok(f(this->as_ok()));}
    return err(this->as_err());
}

Synopsis

#include <toml/result.hpp>

template <typename F>
result< detail::return_type_of_t< F, value_type const  & >, error_type > map(F &&f) const &

Description

No description yet.

Mentioned in

Source

Lines 470-476 in toml/result.hpp.

template<typename F>
result<detail::return_type_of_t<F, value_type const&>, error_type>
map(F&& f) const&
{
    if(this->is_ok()){return ok(f(this->as_ok()));}
    return err(this->as_err());
}

Synopsis

#include <toml/result.hpp>

template <typename F>
result< detail::return_type_of_t< F, value_type && >, error_type > map(F &&f) &&

Description

No description yet.

Mentioned in

Source

Lines 477-483 in toml/result.hpp.

template<typename F>
result<detail::return_type_of_t<F, value_type &&>, error_type>
map(F&& f) &&
{
    if(this->is_ok()){return ok(f(std::move(this->as_ok())));}
    return err(std::move(this->as_err()));
}





Add Discussion as Guest

Log in