/**
 * Autogenerated by Thrift for /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_fbthrift/fbthrift/work/fbthrift-2025.01.13.00/thrift/lib/thrift/protocol_detail.thrift
 *
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
 *  @generated @nocommit
 */
#pragma once

#include "thrift/lib/thrift/gen-cpp2/protocol_detail_metadata.h"
#include <thrift/lib/cpp2/visitation/visit_union.h>

namespace apache {
namespace thrift {
namespace detail {

template <>
struct VisitUnion<::apache::thrift::protocol::detail::detail::Value> {

  template <typename F, typename T>
  decltype(auto) operator()([[maybe_unused]] F&& f, T&& t) const {
    using Union = std::remove_reference_t<T>;
    switch (t.getType()) {
    case Union::Type::boolValue:
      return f(0, *static_cast<T&&>(t).boolValue_ref());
    case Union::Type::byteValue:
      return f(1, *static_cast<T&&>(t).byteValue_ref());
    case Union::Type::i16Value:
      return f(2, *static_cast<T&&>(t).i16Value_ref());
    case Union::Type::i32Value:
      return f(3, *static_cast<T&&>(t).i32Value_ref());
    case Union::Type::i64Value:
      return f(4, *static_cast<T&&>(t).i64Value_ref());
    case Union::Type::floatValue:
      return f(5, *static_cast<T&&>(t).floatValue_ref());
    case Union::Type::doubleValue:
      return f(6, *static_cast<T&&>(t).doubleValue_ref());
    case Union::Type::stringValue:
      return f(7, *static_cast<T&&>(t).stringValue_ref());
    case Union::Type::binaryValue:
      return f(8, *static_cast<T&&>(t).binaryValue_ref());
    case Union::Type::objectValue:
      return f(9, *static_cast<T&&>(t).objectValue_ref());
    case Union::Type::listValue:
      return f(10, *static_cast<T&&>(t).listValue_ref());
    case Union::Type::setValue:
      return f(11, *static_cast<T&&>(t).setValue_ref());
    case Union::Type::mapValue:
      return f(12, *static_cast<T&&>(t).mapValue_ref());
    case Union::Type::__EMPTY__:
      return decltype(f(0, *static_cast<T&&>(t).boolValue_ref()))();
    }
  }
};
} // namespace detail
} // namespace thrift
} // namespace apache
