12#include <boost/optional.hpp>
16#pragma warning(disable:4583)
17#pragma warning(disable:4582)
18#include <boost/variant2/variant.hpp>
21#include <boost/variant2/variant.hpp>
37 const std::string &
What()
const {
41 MSGPACK_DEFINE_ARRAY(
_what)
48 std::string
_what{
"unknown error"};
61 template <
typename TValue>
64 template <
typename TValue>
66 _data = std::forward<TValue>(value);
70 return _data.index() == 0;
73 template <
typename... Ts>
80 return boost::variant2::get<error_type>(
_data);
85 return boost::variant2::get<value_type>(
_data);
90 return boost::variant2::get<value_type>(
_data);
93 operator bool()
const {
97 MSGPACK_DEFINE_ARRAY(
_data)
101 boost::variant2::variant<error_type, value_type>
_data;
113 return success_flag{};
121 return _data.has_value();
124 template <
typename... Ts>
134 operator bool()
const {
138 MSGPACK_DEFINE_ARRAY(
_data)
142 struct success_flag {};
#define DEBUG_ASSERT(predicate)
const std::string & What() const
ResponseError(std::string message)
Response(ResponseError error)
static Response Success()
void SetError(Ts &&... args)
boost::optional< error_type > _data
const error_type & GetError() const
void Reset(TValue &&value)
const value_type & Get() const
boost::variant2::variant< error_type, value_type > _data
void SetError(Ts &&... args)
const error_type & GetError() const
This file contains definitions of common data structures used in traffic manager.