/**
 * Autogenerated by Thrift for /opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_devel_fbthrift/fbthrift/work/fbthrift-2024.01.08.00/thrift/lib/thrift/type_rep.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/type_rep_metadata.h"
#include <thrift/lib/cpp2/visitation/visit_union.h>

namespace apache {
namespace thrift {
namespace detail {

template <>
struct VisitUnion<::apache::thrift::type::ProtocolUnion> {

  template <typename F, typename T>
  decltype(auto) operator()(FOLLY_MAYBE_UNUSED F&& f, T&& t) const {
    using Union = std::remove_reference_t<T>;
    switch (t.getType()) {
    case Union::Type::standard:
      return f(0, *static_cast<T&&>(t).standard_ref());
    case Union::Type::custom:
      return f(1, *static_cast<T&&>(t).custom_ref());
    case Union::Type::id:
      return f(2, *static_cast<T&&>(t).id_ref());
    case Union::Type::__EMPTY__:
      return decltype(f(0, *static_cast<T&&>(t).standard_ref()))();
    }
  }
};
} // namespace detail
} // namespace thrift
} // namespace apache
