Function visit

Summary

#include <toml/value.hpp>

(1) template <typename Visitor, typename C, template< typename ... > class T, template< typename ... > class A>
    detail::return_type_of_t< Visitor, const toml::boolean & > visit(Visitor &&visitor, const toml::basic_value< C, T, A > &v)

(2) template <typename Visitor, typename C, template< typename ... > class T, template< typename ... > class A>
    detail::return_type_of_t< Visitor, toml::boolean & > visit(Visitor &&visitor, toml::basic_value< C, T, A > &v)

(3) template <typename Visitor, typename C, template< typename ... > class T, template< typename ... > class A>
    detail::return_type_of_t< Visitor, toml::boolean && > visit(Visitor &&visitor, toml::basic_value< C, T, A > &&v)

Function overload

Synopsis

#include <toml/value.hpp>

template <typename Visitor, typename C, template< typename ... > class T, template< typename ... > class A>
detail::return_type_of_t< Visitor, const toml::boolean & > visit(Visitor &&visitor, const toml::basic_value< C, T, A > &v)

Description

No description yet.

Mentioned in

Source

Lines 1962-1984 in toml/value.hpp.

template<typename Visitor, typename C,
         template<typename ...> class T, template<typename ...> class A>
detail::return_type_of_t<Visitor, const toml::boolean&>
visit(Visitor&& visitor, const toml::basic_value<C, T, A>& v)
{
    switch(v.type())
    {
        case value_t::boolean        : {return visitor(v.as_boolean        ());}
        case value_t::integer        : {return visitor(v.as_integer        ());}
        case value_t::floating       : {return visitor(v.as_floating       ());}
        case value_t::string         : {return visitor(v.as_string         ());}
        case value_t::offset_datetime: {return visitor(v.as_offset_datetime());}
        case value_t::local_datetime : {return visitor(v.as_local_datetime ());}
        case value_t::local_date     : {return visitor(v.as_local_date     ());}
        case value_t::local_time     : {return visitor(v.as_local_time     ());}
        case value_t::array          : {return visitor(v.as_array          ());}
        case value_t::table          : {return visitor(v.as_table          ());}
        case value_t::empty          : break;
        default: break;
    }
    throw std::runtime_error(format_error("[error] toml::visit: toml::basic_value "
            "does not have any valid basic_value.", v, "here"));
}

Synopsis

#include <toml/value.hpp>

template <typename Visitor, typename C, template< typename ... > class T, template< typename ... > class A>
detail::return_type_of_t< Visitor, toml::boolean & > visit(Visitor &&visitor, toml::basic_value< C, T, A > &v)

Description

No description yet.

Mentioned in

Source

Lines 1986-2008 in toml/value.hpp.

template<typename Visitor, typename C,
         template<typename ...> class T, template<typename ...> class A>
detail::return_type_of_t<Visitor, toml::boolean&>
visit(Visitor&& visitor, toml::basic_value<C, T, A>& v)
{
    switch(v.type())
    {
        case value_t::boolean        : {return visitor(v.as_boolean        ());}
        case value_t::integer        : {return visitor(v.as_integer        ());}
        case value_t::floating       : {return visitor(v.as_floating       ());}
        case value_t::string         : {return visitor(v.as_string         ());}
        case value_t::offset_datetime: {return visitor(v.as_offset_datetime());}
        case value_t::local_datetime : {return visitor(v.as_local_datetime ());}
        case value_t::local_date     : {return visitor(v.as_local_date     ());}
        case value_t::local_time     : {return visitor(v.as_local_time     ());}
        case value_t::array          : {return visitor(v.as_array          ());}
        case value_t::table          : {return visitor(v.as_table          ());}
        case value_t::empty          : break;
        default: break;
    }
    throw std::runtime_error(format_error("[error] toml::visit: toml::basic_value "
            "does not have any valid basic_value.", v, "here"));
}

Synopsis

#include <toml/value.hpp>

template <typename Visitor, typename C, template< typename ... > class T, template< typename ... > class A>
detail::return_type_of_t< Visitor, toml::boolean && > visit(Visitor &&visitor, toml::basic_value< C, T, A > &&v)

Description

No description yet.

Mentioned in

Source

Lines 2010-2032 in toml/value.hpp.

template<typename Visitor, typename C,
         template<typename ...> class T, template<typename ...> class A>
detail::return_type_of_t<Visitor, toml::boolean&&>
visit(Visitor&& visitor, toml::basic_value<C, T, A>&& v)
{
    switch(v.type())
    {
        case value_t::boolean        : {return visitor(std::move(v.as_boolean        ()));}
        case value_t::integer        : {return visitor(std::move(v.as_integer        ()));}
        case value_t::floating       : {return visitor(std::move(v.as_floating       ()));}
        case value_t::string         : {return visitor(std::move(v.as_string         ()));}
        case value_t::offset_datetime: {return visitor(std::move(v.as_offset_datetime()));}
        case value_t::local_datetime : {return visitor(std::move(v.as_local_datetime ()));}
        case value_t::local_date     : {return visitor(std::move(v.as_local_date     ()));}
        case value_t::local_time     : {return visitor(std::move(v.as_local_time     ()));}
        case value_t::array          : {return visitor(std::move(v.as_array          ()));}
        case value_t::table          : {return visitor(std::move(v.as_table          ()));}
        case value_t::empty          : break;
        default: break;
    }
    throw std::runtime_error(format_error("[error] toml::visit: toml::basic_value "
            "does not have any valid basic_value.", v, "here"));
}





Add Discussion as Guest

Log in