userver: userver/formats/parse/variant.hpp File Reference
Loading...
Searching...
No Matches
variant.hpp File Reference

Detailed Description

Ineffective but generic parser for std::variant type.

Parsing is performed for each of the N alternatives in variant, N-1 exceptions is thrown and caught during the parsing.

Definition in file variant.hpp.

Go to the source code of this file.

#include <optional>
#include <typeinfo>
#include <variant>
#include <userver/compiler/demangle.hpp>
#include <userver/formats/parse/to.hpp>
+ Include dependency graph for variant.hpp:
+ This graph shows which files directly or indirectly include this file:

Namespaces

namespace  formats
 Value formats representation, parsing and serialization.
 
namespace  formats::json
 JSON support.
 
namespace  formats::parse
 Generic parsers and converters.
 

Functions

template<typename ParseException , typename Variant , typename TypeA >
void formats::parse::ThrowVariantAmbiguousParse (const std::string &path, std::type_index type_b)
 
template<class ParseException , typename Variant >
void formats::parse::ThrowVariantParseException (const std::string &path)
 
template<class Value , typename... Types>
std::variant< Types... > formats::parse::Parse (const Value &value, formats::parse::To< std::variant< Types... > >)