/**
 * Autogenerated by Thrift for /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_fbthrift/fbthrift/work/fbthrift-2025.01.13.00/thrift/lib/thrift/protocol.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_metadata.h"
#include <thrift/lib/cpp2/visitation/visit_union.h>

namespace apache {
namespace thrift {
namespace detail {

template <>
struct VisitUnion<::apache::thrift::protocol::MaskedData> {

  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::full:
      return f(0, *static_cast<T&&>(t).full_ref());
    case Union::Type::fields:
      return f(1, *static_cast<T&&>(t).fields_ref());
    case Union::Type::values:
      return f(2, *static_cast<T&&>(t).values_ref());
    case Union::Type::__EMPTY__:
      return decltype(f(0, *static_cast<T&&>(t).full_ref()))();
    }
  }
};
} // namespace detail
} // namespace thrift
} // namespace apache
