/**
 * Autogenerated by Thrift for /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_fbthrift/fbthrift/work/fbthrift-2022.08.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/cpp2/gen/module_types_h.h>

#include <thrift/lib/cpp2/type/Tag.h>

#include "thrift/annotation/gen-cpp2/thrift_types.h"
#include "thrift/lib/thrift/gen-cpp2/id_types.h"
#include "thrift/lib/thrift/gen-cpp2/standard_types.h"

namespace apache {
namespace thrift {
namespace tag {
struct seconds;
struct nanos;
struct seconds;
struct nanos;
struct numerator;
struct denominator;
struct standard;
struct custom;
struct id;
struct name;
struct params;
struct source;
struct offset;
struct line;
struct col;
struct begin;
struct end;
} // namespace tag
namespace detail {
#ifndef APACHE_THRIFT_ACCESSOR_seconds
#define APACHE_THRIFT_ACCESSOR_seconds
APACHE_THRIFT_DEFINE_ACCESSOR(seconds);
#endif
#ifndef APACHE_THRIFT_ACCESSOR_nanos
#define APACHE_THRIFT_ACCESSOR_nanos
APACHE_THRIFT_DEFINE_ACCESSOR(nanos);
#endif
#ifndef APACHE_THRIFT_ACCESSOR_seconds
#define APACHE_THRIFT_ACCESSOR_seconds
APACHE_THRIFT_DEFINE_ACCESSOR(seconds);
#endif
#ifndef APACHE_THRIFT_ACCESSOR_nanos
#define APACHE_THRIFT_ACCESSOR_nanos
APACHE_THRIFT_DEFINE_ACCESSOR(nanos);
#endif
#ifndef APACHE_THRIFT_ACCESSOR_numerator
#define APACHE_THRIFT_ACCESSOR_numerator
APACHE_THRIFT_DEFINE_ACCESSOR(numerator);
#endif
#ifndef APACHE_THRIFT_ACCESSOR_denominator
#define APACHE_THRIFT_ACCESSOR_denominator
APACHE_THRIFT_DEFINE_ACCESSOR(denominator);
#endif
#ifndef APACHE_THRIFT_ACCESSOR_standard
#define APACHE_THRIFT_ACCESSOR_standard
APACHE_THRIFT_DEFINE_ACCESSOR(standard);
#endif
#ifndef APACHE_THRIFT_ACCESSOR_custom
#define APACHE_THRIFT_ACCESSOR_custom
APACHE_THRIFT_DEFINE_ACCESSOR(custom);
#endif
#ifndef APACHE_THRIFT_ACCESSOR_id
#define APACHE_THRIFT_ACCESSOR_id
APACHE_THRIFT_DEFINE_ACCESSOR(id);
#endif
#ifndef APACHE_THRIFT_ACCESSOR_name
#define APACHE_THRIFT_ACCESSOR_name
APACHE_THRIFT_DEFINE_ACCESSOR(name);
#endif
#ifndef APACHE_THRIFT_ACCESSOR_params
#define APACHE_THRIFT_ACCESSOR_params
APACHE_THRIFT_DEFINE_ACCESSOR(params);
#endif
#ifndef APACHE_THRIFT_ACCESSOR_source
#define APACHE_THRIFT_ACCESSOR_source
APACHE_THRIFT_DEFINE_ACCESSOR(source);
#endif
#ifndef APACHE_THRIFT_ACCESSOR_offset
#define APACHE_THRIFT_ACCESSOR_offset
APACHE_THRIFT_DEFINE_ACCESSOR(offset);
#endif
#ifndef APACHE_THRIFT_ACCESSOR_line
#define APACHE_THRIFT_ACCESSOR_line
APACHE_THRIFT_DEFINE_ACCESSOR(line);
#endif
#ifndef APACHE_THRIFT_ACCESSOR_col
#define APACHE_THRIFT_ACCESSOR_col
APACHE_THRIFT_DEFINE_ACCESSOR(col);
#endif
#ifndef APACHE_THRIFT_ACCESSOR_begin
#define APACHE_THRIFT_ACCESSOR_begin
APACHE_THRIFT_DEFINE_ACCESSOR(begin);
#endif
#ifndef APACHE_THRIFT_ACCESSOR_end
#define APACHE_THRIFT_ACCESSOR_end
APACHE_THRIFT_DEFINE_ACCESSOR(end);
#endif
} // namespace detail
} // namespace thrift
} // namespace apache

// BEGIN declare_enums

// END declare_enums
// BEGIN forward_declare
namespace apache { namespace thrift { namespace type {
class DurationStruct;
class TimeStruct;
class FractionStruct;
class ProtocolUnion;
class TypeStruct;
class SourceLocation;
class SourceRange;
}}} // apache::thrift::type
// END forward_declare
// BEGIN hash_and_equal_to
// END hash_and_equal_to
namespace apache { namespace thrift { namespace type {
using ::apache::thrift::detail::operator!=;
using ::apache::thrift::detail::operator>;
using ::apache::thrift::detail::operator<=;
using ::apache::thrift::detail::operator>=;


class DurationStruct final  {
 private:
  friend struct ::apache::thrift::detail::st::struct_private_access;
  template<class> friend struct ::apache::thrift::detail::invoke_reffer;

  //  used by a static_assert in the corresponding source
  static constexpr bool __fbthrift_cpp2_gen_json = false;
  static const char* __fbthrift_thrift_uri();
  static const folly::StringPiece __fbthrift_get_field_name(::apache::thrift::FieldOrdinal ord);
  static constexpr std::size_t __fbthrift_field_size_v = 2;

  template<class T>
  using __fbthrift_id = folly::type_pack_element_t<folly::to_underlying(T::value),
                                                   void,
                                                   ::apache::thrift::field_id<1>,
                                                   ::apache::thrift::field_id<2>>;

  template<class T>
  using __fbthrift_type_tag = folly::type_pack_element_t<folly::to_underlying(T::value),
                                                         void,
                                                         ::apache::thrift::type::i64_t,
                                                         ::apache::thrift::type::i32_t>;

  template<class T>
  using __fbthrift_ident = folly::type_pack_element_t<folly::to_underlying(T::value),
                                                      void,
                                                      ::apache::thrift::tag::seconds,
                                                      ::apache::thrift::tag::nanos>;

  struct __fbthrift_ordinal_impl {
#if defined(_MSC_VER) || defined(__clang__)
    template<class> static constexpr int value = 0;
    template<> static constexpr int value<::apache::thrift::field_id<1>> = 1;
    template<> static constexpr int value<::apache::thrift::tag::seconds> = 1;
    template<> static constexpr int value<::apache::thrift::field_id<2>> = 2;
    template<> static constexpr int value<::apache::thrift::tag::nanos> = 2;
#else
    template<class T> static constexpr int value_impl(folly::tag_t<T>) { return 0; }
    static constexpr int value_impl(folly::tag_t<::apache::thrift::field_id<1>>) { return 1; }
    static constexpr int value_impl(folly::tag_t<::apache::thrift::tag::seconds>) { return 1; }
    static constexpr int value_impl(folly::tag_t<::apache::thrift::field_id<2>>) { return 2; }
    static constexpr int value_impl(folly::tag_t<::apache::thrift::tag::nanos>) { return 2; }
    template<class T> static constexpr int value = value_impl(folly::tag_t<T>{});
#endif
  };

  struct __fbthrift_ordinal_impl_for_non_unique_type {
    template<class, class, class> struct Impl { static constexpr int value = 0; };
    template<class T> struct Impl<::apache::thrift::type::i64_t, T, std::enable_if_t<sizeof(T) != -1>> { static constexpr int value = 1; };
    template<class T> struct Impl<::apache::thrift::type::i32_t, T, std::enable_if_t<sizeof(T) != -2>> { static constexpr int value = 2; };

    template<class T> static constexpr int value = Impl<T, T, void>::value;
  };

  template<class T> using __fbthrift_ordinal = ::apache::thrift::field_ordinal<
    std::conditional_t<
        __fbthrift_ordinal_impl::value<T> != 0,
        __fbthrift_ordinal_impl,
        __fbthrift_ordinal_impl_for_non_unique_type>::template value<T>
  >;

  void __fbthrift_clear();
  void __fbthrift_clear_terse_fields();
  bool __fbthrift_is_empty() const;

 public:
  using __fbthrift_cpp2_type = DurationStruct;
  static constexpr bool __fbthrift_cpp2_is_union =
    false;


 public:

  DurationStruct() :
      __fbthrift_field_seconds(),
      __fbthrift_field_nanos() {
  }
  // FragileConstructor for use in initialization lists only.
  [[deprecated("This constructor is deprecated")]]
  DurationStruct(apache::thrift::FragileConstructor, ::std::int64_t seconds__arg, ::std::int32_t nanos__arg);

  DurationStruct(DurationStruct&&) = default;

  DurationStruct(const DurationStruct&) = default;


  DurationStruct& operator=(DurationStruct&&) = default;

  DurationStruct& operator=(const DurationStruct&) = default;
 private:
  ::std::int64_t __fbthrift_field_seconds;
 private:
  ::std::int32_t __fbthrift_field_nanos;
 private:
  apache::thrift::detail::isset_bitset<2, apache::thrift::detail::IssetBitsetOption::Unpacked> __isset;

 public:

  bool operator==(const DurationStruct&) const;
  bool operator<(const DurationStruct&) const;

  template <typename..., typename T = ::std::int64_t>
  FOLLY_ERASE ::apache::thrift::field_ref<const T&> seconds_ref() const& {
    return {this->__fbthrift_field_seconds, __isset.at(0), __isset.bit(0)};
  }

  template <typename..., typename T = ::std::int64_t>
  FOLLY_ERASE ::apache::thrift::field_ref<const T&&> seconds_ref() const&& {
    return {static_cast<const T&&>(this->__fbthrift_field_seconds), __isset.at(0), __isset.bit(0)};
  }

  template <typename..., typename T = ::std::int64_t>
  FOLLY_ERASE ::apache::thrift::field_ref<T&> seconds_ref() & {
    return {this->__fbthrift_field_seconds, __isset.at(0), __isset.bit(0)};
  }

  template <typename..., typename T = ::std::int64_t>
  FOLLY_ERASE ::apache::thrift::field_ref<T&&> seconds_ref() && {
    return {static_cast<T&&>(this->__fbthrift_field_seconds), __isset.at(0), __isset.bit(0)};
  }

  template <typename..., typename T = ::std::int64_t>
  FOLLY_ERASE ::apache::thrift::field_ref<const T&> seconds() const& {
    return {this->__fbthrift_field_seconds, __isset.at(0), __isset.bit(0)};
  }

  template <typename..., typename T = ::std::int64_t>
  FOLLY_ERASE ::apache::thrift::field_ref<const T&&> seconds() const&& {
    return {static_cast<const T&&>(this->__fbthrift_field_seconds), __isset.at(0), __isset.bit(0)};
  }

  template <typename..., typename T = ::std::int64_t>
  FOLLY_ERASE ::apache::thrift::field_ref<T&> seconds() & {
    return {this->__fbthrift_field_seconds, __isset.at(0), __isset.bit(0)};
  }

  template <typename..., typename T = ::std::int64_t>
  FOLLY_ERASE ::apache::thrift::field_ref<T&&> seconds() && {
    return {static_cast<T&&>(this->__fbthrift_field_seconds), __isset.at(0), __isset.bit(0)};
  }

  template <typename..., typename T = ::std::int32_t>
  FOLLY_ERASE ::apache::thrift::field_ref<const T&> nanos_ref() const& {
    return {this->__fbthrift_field_nanos, __isset.at(1), __isset.bit(1)};
  }

  template <typename..., typename T = ::std::int32_t>
  FOLLY_ERASE ::apache::thrift::field_ref<const T&&> nanos_ref() const&& {
    return {static_cast<const T&&>(this->__fbthrift_field_nanos), __isset.at(1), __isset.bit(1)};
  }

  template <typename..., typename T = ::std::int32_t>
  FOLLY_ERASE ::apache::thrift::field_ref<T&> nanos_ref() & {
    return {this->__fbthrift_field_nanos, __isset.at(1), __isset.bit(1)};
  }

  template <typename..., typename T = ::std::int32_t>
  FOLLY_ERASE ::apache::thrift::field_ref<T&&> nanos_ref() && {
    return {static_cast<T&&>(this->__fbthrift_field_nanos), __isset.at(1), __isset.bit(1)};
  }

  template <typename..., typename T = ::std::int32_t>
  FOLLY_ERASE ::apache::thrift::field_ref<const T&> nanos() const& {
    return {this->__fbthrift_field_nanos, __isset.at(1), __isset.bit(1)};
  }

  template <typename..., typename T = ::std::int32_t>
  FOLLY_ERASE ::apache::thrift::field_ref<const T&&> nanos() const&& {
    return {static_cast<const T&&>(this->__fbthrift_field_nanos), __isset.at(1), __isset.bit(1)};
  }

  template <typename..., typename T = ::std::int32_t>
  FOLLY_ERASE ::apache::thrift::field_ref<T&> nanos() & {
    return {this->__fbthrift_field_nanos, __isset.at(1), __isset.bit(1)};
  }

  template <typename..., typename T = ::std::int32_t>
  FOLLY_ERASE ::apache::thrift::field_ref<T&&> nanos() && {
    return {static_cast<T&&>(this->__fbthrift_field_nanos), __isset.at(1), __isset.bit(1)};
  }

  ::std::int64_t get_seconds() const {
    return __fbthrift_field_seconds;
  }

  [[deprecated("Use `FOO.seconds_ref() = BAR;` instead of `FOO.set_seconds(BAR);`")]]
  ::std::int64_t& set_seconds(::std::int64_t seconds_) {
    seconds_ref() = seconds_;
    return __fbthrift_field_seconds;
  }

  ::std::int32_t get_nanos() const {
    return __fbthrift_field_nanos;
  }

  [[deprecated("Use `FOO.nanos_ref() = BAR;` instead of `FOO.set_nanos(BAR);`")]]
  ::std::int32_t& set_nanos(::std::int32_t nanos_) {
    nanos_ref() = nanos_;
    return __fbthrift_field_nanos;
  }

  template <class Protocol_>
  unsigned long read(Protocol_* iprot);
  template <class Protocol_>
  uint32_t serializedSize(Protocol_ const* prot_) const;
  template <class Protocol_>
  uint32_t serializedSizeZC(Protocol_ const* prot_) const;
  template <class Protocol_>
  uint32_t write(Protocol_* prot_) const;

 private:
  template <class Protocol_>
  void readNoXfer(Protocol_* iprot);

  friend class ::apache::thrift::Cpp2Ops<DurationStruct>;
  friend void swap(DurationStruct& a, DurationStruct& b);
};

template <class Protocol_>
unsigned long DurationStruct::read(Protocol_* iprot) {
  auto _xferStart = iprot->getCursorPosition();
  readNoXfer(iprot);
  return iprot->getCursorPosition() - _xferStart;
}


class TimeStruct final  {
 private:
  friend struct ::apache::thrift::detail::st::struct_private_access;
  template<class> friend struct ::apache::thrift::detail::invoke_reffer;

  //  used by a static_assert in the corresponding source
  static constexpr bool __fbthrift_cpp2_gen_json = false;
  static const char* __fbthrift_thrift_uri();
  static const folly::StringPiece __fbthrift_get_field_name(::apache::thrift::FieldOrdinal ord);
  static constexpr std::size_t __fbthrift_field_size_v = 2;

  template<class T>
  using __fbthrift_id = folly::type_pack_element_t<folly::to_underlying(T::value),
                                                   void,
                                                   ::apache::thrift::field_id<1>,
                                                   ::apache::thrift::field_id<2>>;

  template<class T>
  using __fbthrift_type_tag = folly::type_pack_element_t<folly::to_underlying(T::value),
                                                         void,
                                                         ::apache::thrift::type::i64_t,
                                                         ::apache::thrift::type::i32_t>;

  template<class T>
  using __fbthrift_ident = folly::type_pack_element_t<folly::to_underlying(T::value),
                                                      void,
                                                      ::apache::thrift::tag::seconds,
                                                      ::apache::thrift::tag::nanos>;

  struct __fbthrift_ordinal_impl {
#if defined(_MSC_VER) || defined(__clang__)
    template<class> static constexpr int value = 0;
    template<> static constexpr int value<::apache::thrift::field_id<1>> = 1;
    template<> static constexpr int value<::apache::thrift::tag::seconds> = 1;
    template<> static constexpr int value<::apache::thrift::field_id<2>> = 2;
    template<> static constexpr int value<::apache::thrift::tag::nanos> = 2;
#else
    template<class T> static constexpr int value_impl(folly::tag_t<T>) { return 0; }
    static constexpr int value_impl(folly::tag_t<::apache::thrift::field_id<1>>) { return 1; }
    static constexpr int value_impl(folly::tag_t<::apache::thrift::tag::seconds>) { return 1; }
    static constexpr int value_impl(folly::tag_t<::apache::thrift::field_id<2>>) { return 2; }
    static constexpr int value_impl(folly::tag_t<::apache::thrift::tag::nanos>) { return 2; }
    template<class T> static constexpr int value = value_impl(folly::tag_t<T>{});
#endif
  };

  struct __fbthrift_ordinal_impl_for_non_unique_type {
    template<class, class, class> struct Impl { static constexpr int value = 0; };
    template<class T> struct Impl<::apache::thrift::type::i64_t, T, std::enable_if_t<sizeof(T) != -1>> { static constexpr int value = 1; };
    template<class T> struct Impl<::apache::thrift::type::i32_t, T, std::enable_if_t<sizeof(T) != -2>> { static constexpr int value = 2; };

    template<class T> static constexpr int value = Impl<T, T, void>::value;
  };

  template<class T> using __fbthrift_ordinal = ::apache::thrift::field_ordinal<
    std::conditional_t<
        __fbthrift_ordinal_impl::value<T> != 0,
        __fbthrift_ordinal_impl,
        __fbthrift_ordinal_impl_for_non_unique_type>::template value<T>
  >;

  void __fbthrift_clear();
  void __fbthrift_clear_terse_fields();
  bool __fbthrift_is_empty() const;

 public:
  using __fbthrift_cpp2_type = TimeStruct;
  static constexpr bool __fbthrift_cpp2_is_union =
    false;


 public:

  TimeStruct() :
      __fbthrift_field_seconds(),
      __fbthrift_field_nanos() {
  }
  // FragileConstructor for use in initialization lists only.
  [[deprecated("This constructor is deprecated")]]
  TimeStruct(apache::thrift::FragileConstructor, ::std::int64_t seconds__arg, ::std::int32_t nanos__arg);

  TimeStruct(TimeStruct&&) = default;

  TimeStruct(const TimeStruct&) = default;


  TimeStruct& operator=(TimeStruct&&) = default;

  TimeStruct& operator=(const TimeStruct&) = default;
 private:
  ::std::int64_t __fbthrift_field_seconds;
 private:
  ::std::int32_t __fbthrift_field_nanos;
 private:
  apache::thrift::detail::isset_bitset<2, apache::thrift::detail::IssetBitsetOption::Unpacked> __isset;

 public:

  bool operator==(const TimeStruct&) const;
  bool operator<(const TimeStruct&) const;

  template <typename..., typename T = ::std::int64_t>
  FOLLY_ERASE ::apache::thrift::field_ref<const T&> seconds_ref() const& {
    return {this->__fbthrift_field_seconds, __isset.at(0), __isset.bit(0)};
  }

  template <typename..., typename T = ::std::int64_t>
  FOLLY_ERASE ::apache::thrift::field_ref<const T&&> seconds_ref() const&& {
    return {static_cast<const T&&>(this->__fbthrift_field_seconds), __isset.at(0), __isset.bit(0)};
  }

  template <typename..., typename T = ::std::int64_t>
  FOLLY_ERASE ::apache::thrift::field_ref<T&> seconds_ref() & {
    return {this->__fbthrift_field_seconds, __isset.at(0), __isset.bit(0)};
  }

  template <typename..., typename T = ::std::int64_t>
  FOLLY_ERASE ::apache::thrift::field_ref<T&&> seconds_ref() && {
    return {static_cast<T&&>(this->__fbthrift_field_seconds), __isset.at(0), __isset.bit(0)};
  }

  template <typename..., typename T = ::std::int64_t>
  FOLLY_ERASE ::apache::thrift::field_ref<const T&> seconds() const& {
    return {this->__fbthrift_field_seconds, __isset.at(0), __isset.bit(0)};
  }

  template <typename..., typename T = ::std::int64_t>
  FOLLY_ERASE ::apache::thrift::field_ref<const T&&> seconds() const&& {
    return {static_cast<const T&&>(this->__fbthrift_field_seconds), __isset.at(0), __isset.bit(0)};
  }

  template <typename..., typename T = ::std::int64_t>
  FOLLY_ERASE ::apache::thrift::field_ref<T&> seconds() & {
    return {this->__fbthrift_field_seconds, __isset.at(0), __isset.bit(0)};
  }

  template <typename..., typename T = ::std::int64_t>
  FOLLY_ERASE ::apache::thrift::field_ref<T&&> seconds() && {
    return {static_cast<T&&>(this->__fbthrift_field_seconds), __isset.at(0), __isset.bit(0)};
  }

  template <typename..., typename T = ::std::int32_t>
  FOLLY_ERASE ::apache::thrift::field_ref<const T&> nanos_ref() const& {
    return {this->__fbthrift_field_nanos, __isset.at(1), __isset.bit(1)};
  }

  template <typename..., typename T = ::std::int32_t>
  FOLLY_ERASE ::apache::thrift::field_ref<const T&&> nanos_ref() const&& {
    return {static_cast<const T&&>(this->__fbthrift_field_nanos), __isset.at(1), __isset.bit(1)};
  }

  template <typename..., typename T = ::std::int32_t>
  FOLLY_ERASE ::apache::thrift::field_ref<T&> nanos_ref() & {
    return {this->__fbthrift_field_nanos, __isset.at(1), __isset.bit(1)};
  }

  template <typename..., typename T = ::std::int32_t>
  FOLLY_ERASE ::apache::thrift::field_ref<T&&> nanos_ref() && {
    return {static_cast<T&&>(this->__fbthrift_field_nanos), __isset.at(1), __isset.bit(1)};
  }

  template <typename..., typename T = ::std::int32_t>
  FOLLY_ERASE ::apache::thrift::field_ref<const T&> nanos() const& {
    return {this->__fbthrift_field_nanos, __isset.at(1), __isset.bit(1)};
  }

  template <typename..., typename T = ::std::int32_t>
  FOLLY_ERASE ::apache::thrift::field_ref<const T&&> nanos() const&& {
    return {static_cast<const T&&>(this->__fbthrift_field_nanos), __isset.at(1), __isset.bit(1)};
  }

  template <typename..., typename T = ::std::int32_t>
  FOLLY_ERASE ::apache::thrift::field_ref<T&> nanos() & {
    return {this->__fbthrift_field_nanos, __isset.at(1), __isset.bit(1)};
  }

  template <typename..., typename T = ::std::int32_t>
  FOLLY_ERASE ::apache::thrift::field_ref<T&&> nanos() && {
    return {static_cast<T&&>(this->__fbthrift_field_nanos), __isset.at(1), __isset.bit(1)};
  }

  ::std::int64_t get_seconds() const {
    return __fbthrift_field_seconds;
  }

  [[deprecated("Use `FOO.seconds_ref() = BAR;` instead of `FOO.set_seconds(BAR);`")]]
  ::std::int64_t& set_seconds(::std::int64_t seconds_) {
    seconds_ref() = seconds_;
    return __fbthrift_field_seconds;
  }

  ::std::int32_t get_nanos() const {
    return __fbthrift_field_nanos;
  }

  [[deprecated("Use `FOO.nanos_ref() = BAR;` instead of `FOO.set_nanos(BAR);`")]]
  ::std::int32_t& set_nanos(::std::int32_t nanos_) {
    nanos_ref() = nanos_;
    return __fbthrift_field_nanos;
  }

  template <class Protocol_>
  unsigned long read(Protocol_* iprot);
  template <class Protocol_>
  uint32_t serializedSize(Protocol_ const* prot_) const;
  template <class Protocol_>
  uint32_t serializedSizeZC(Protocol_ const* prot_) const;
  template <class Protocol_>
  uint32_t write(Protocol_* prot_) const;

 private:
  template <class Protocol_>
  void readNoXfer(Protocol_* iprot);

  friend class ::apache::thrift::Cpp2Ops<TimeStruct>;
  friend void swap(TimeStruct& a, TimeStruct& b);
};

template <class Protocol_>
unsigned long TimeStruct::read(Protocol_* iprot) {
  auto _xferStart = iprot->getCursorPosition();
  readNoXfer(iprot);
  return iprot->getCursorPosition() - _xferStart;
}


class FractionStruct final  {
 private:
  friend struct ::apache::thrift::detail::st::struct_private_access;
  template<class> friend struct ::apache::thrift::detail::invoke_reffer;

  //  used by a static_assert in the corresponding source
  static constexpr bool __fbthrift_cpp2_gen_json = false;
  static const char* __fbthrift_thrift_uri();
  static const folly::StringPiece __fbthrift_get_field_name(::apache::thrift::FieldOrdinal ord);
  static constexpr std::size_t __fbthrift_field_size_v = 2;

  template<class T>
  using __fbthrift_id = folly::type_pack_element_t<folly::to_underlying(T::value),
                                                   void,
                                                   ::apache::thrift::field_id<1>,
                                                   ::apache::thrift::field_id<2>>;

  template<class T>
  using __fbthrift_type_tag = folly::type_pack_element_t<folly::to_underlying(T::value),
                                                         void,
                                                         ::apache::thrift::type::i64_t,
                                                         ::apache::thrift::type::i64_t>;

  template<class T>
  using __fbthrift_ident = folly::type_pack_element_t<folly::to_underlying(T::value),
                                                      void,
                                                      ::apache::thrift::tag::numerator,
                                                      ::apache::thrift::tag::denominator>;

  struct __fbthrift_ordinal_impl {
#if defined(_MSC_VER) || defined(__clang__)
    template<class> static constexpr int value = 0;
    template<> static constexpr int value<::apache::thrift::field_id<1>> = 1;
    template<> static constexpr int value<::apache::thrift::tag::numerator> = 1;
    template<> static constexpr int value<::apache::thrift::field_id<2>> = 2;
    template<> static constexpr int value<::apache::thrift::tag::denominator> = 2;
#else
    template<class T> static constexpr int value_impl(folly::tag_t<T>) { return 0; }
    static constexpr int value_impl(folly::tag_t<::apache::thrift::field_id<1>>) { return 1; }
    static constexpr int value_impl(folly::tag_t<::apache::thrift::tag::numerator>) { return 1; }
    static constexpr int value_impl(folly::tag_t<::apache::thrift::field_id<2>>) { return 2; }
    static constexpr int value_impl(folly::tag_t<::apache::thrift::tag::denominator>) { return 2; }
    template<class T> static constexpr int value = value_impl(folly::tag_t<T>{});
#endif
  };

  struct __fbthrift_ordinal_impl_for_non_unique_type {
    template<class, class, class> struct Impl { static constexpr int value = 0; };
    template<class T> struct Impl<::apache::thrift::type::i64_t, T, std::enable_if_t<sizeof(T) != -1>> { static constexpr int value = 1; };
    template<class T> struct Impl<::apache::thrift::type::i64_t, T, std::enable_if_t<sizeof(T) != -2>> { static constexpr int value = 2; };

    template<class T> static constexpr int value = Impl<T, T, void>::value;
  };

  template<class T> using __fbthrift_ordinal = ::apache::thrift::field_ordinal<
    std::conditional_t<
        __fbthrift_ordinal_impl::value<T> != 0,
        __fbthrift_ordinal_impl,
        __fbthrift_ordinal_impl_for_non_unique_type>::template value<T>
  >;

  void __fbthrift_clear();
  void __fbthrift_clear_terse_fields();
  bool __fbthrift_is_empty() const;

 public:
  using __fbthrift_cpp2_type = FractionStruct;
  static constexpr bool __fbthrift_cpp2_is_union =
    false;


 public:

  FractionStruct() :
      __fbthrift_field_numerator(),
      __fbthrift_field_denominator() {
  }
  // FragileConstructor for use in initialization lists only.
  [[deprecated("This constructor is deprecated")]]
  FractionStruct(apache::thrift::FragileConstructor, ::std::int64_t numerator__arg, ::std::int64_t denominator__arg);

  FractionStruct(FractionStruct&&) = default;

  FractionStruct(const FractionStruct&) = default;


  FractionStruct& operator=(FractionStruct&&) = default;

  FractionStruct& operator=(const FractionStruct&) = default;
 private:
  ::std::int64_t __fbthrift_field_numerator;
 private:
  ::std::int64_t __fbthrift_field_denominator;
 private:
  apache::thrift::detail::isset_bitset<2, apache::thrift::detail::IssetBitsetOption::Unpacked> __isset;

 public:

  bool operator==(const FractionStruct&) const;
  bool operator<(const FractionStruct&) const;

  template <typename..., typename T = ::std::int64_t>
  FOLLY_ERASE ::apache::thrift::field_ref<const T&> numerator_ref() const& {
    return {this->__fbthrift_field_numerator, __isset.at(0), __isset.bit(0)};
  }

  template <typename..., typename T = ::std::int64_t>
  FOLLY_ERASE ::apache::thrift::field_ref<const T&&> numerator_ref() const&& {
    return {static_cast<const T&&>(this->__fbthrift_field_numerator), __isset.at(0), __isset.bit(0)};
  }

  template <typename..., typename T = ::std::int64_t>
  FOLLY_ERASE ::apache::thrift::field_ref<T&> numerator_ref() & {
    return {this->__fbthrift_field_numerator, __isset.at(0), __isset.bit(0)};
  }

  template <typename..., typename T = ::std::int64_t>
  FOLLY_ERASE ::apache::thrift::field_ref<T&&> numerator_ref() && {
    return {static_cast<T&&>(this->__fbthrift_field_numerator), __isset.at(0), __isset.bit(0)};
  }

  template <typename..., typename T = ::std::int64_t>
  FOLLY_ERASE ::apache::thrift::field_ref<const T&> numerator() const& {
    return {this->__fbthrift_field_numerator, __isset.at(0), __isset.bit(0)};
  }

  template <typename..., typename T = ::std::int64_t>
  FOLLY_ERASE ::apache::thrift::field_ref<const T&&> numerator() const&& {
    return {static_cast<const T&&>(this->__fbthrift_field_numerator), __isset.at(0), __isset.bit(0)};
  }

  template <typename..., typename T = ::std::int64_t>
  FOLLY_ERASE ::apache::thrift::field_ref<T&> numerator() & {
    return {this->__fbthrift_field_numerator, __isset.at(0), __isset.bit(0)};
  }

  template <typename..., typename T = ::std::int64_t>
  FOLLY_ERASE ::apache::thrift::field_ref<T&&> numerator() && {
    return {static_cast<T&&>(this->__fbthrift_field_numerator), __isset.at(0), __isset.bit(0)};
  }

  template <typename..., typename T = ::std::int64_t>
  FOLLY_ERASE ::apache::thrift::field_ref<const T&> denominator_ref() const& {
    return {this->__fbthrift_field_denominator, __isset.at(1), __isset.bit(1)};
  }

  template <typename..., typename T = ::std::int64_t>
  FOLLY_ERASE ::apache::thrift::field_ref<const T&&> denominator_ref() const&& {
    return {static_cast<const T&&>(this->__fbthrift_field_denominator), __isset.at(1), __isset.bit(1)};
  }

  template <typename..., typename T = ::std::int64_t>
  FOLLY_ERASE ::apache::thrift::field_ref<T&> denominator_ref() & {
    return {this->__fbthrift_field_denominator, __isset.at(1), __isset.bit(1)};
  }

  template <typename..., typename T = ::std::int64_t>
  FOLLY_ERASE ::apache::thrift::field_ref<T&&> denominator_ref() && {
    return {static_cast<T&&>(this->__fbthrift_field_denominator), __isset.at(1), __isset.bit(1)};
  }

  template <typename..., typename T = ::std::int64_t>
  FOLLY_ERASE ::apache::thrift::field_ref<const T&> denominator() const& {
    return {this->__fbthrift_field_denominator, __isset.at(1), __isset.bit(1)};
  }

  template <typename..., typename T = ::std::int64_t>
  FOLLY_ERASE ::apache::thrift::field_ref<const T&&> denominator() const&& {
    return {static_cast<const T&&>(this->__fbthrift_field_denominator), __isset.at(1), __isset.bit(1)};
  }

  template <typename..., typename T = ::std::int64_t>
  FOLLY_ERASE ::apache::thrift::field_ref<T&> denominator() & {
    return {this->__fbthrift_field_denominator, __isset.at(1), __isset.bit(1)};
  }

  template <typename..., typename T = ::std::int64_t>
  FOLLY_ERASE ::apache::thrift::field_ref<T&&> denominator() && {
    return {static_cast<T&&>(this->__fbthrift_field_denominator), __isset.at(1), __isset.bit(1)};
  }

  ::std::int64_t get_numerator() const {
    return __fbthrift_field_numerator;
  }

  [[deprecated("Use `FOO.numerator_ref() = BAR;` instead of `FOO.set_numerator(BAR);`")]]
  ::std::int64_t& set_numerator(::std::int64_t numerator_) {
    numerator_ref() = numerator_;
    return __fbthrift_field_numerator;
  }

  ::std::int64_t get_denominator() const {
    return __fbthrift_field_denominator;
  }

  [[deprecated("Use `FOO.denominator_ref() = BAR;` instead of `FOO.set_denominator(BAR);`")]]
  ::std::int64_t& set_denominator(::std::int64_t denominator_) {
    denominator_ref() = denominator_;
    return __fbthrift_field_denominator;
  }

  template <class Protocol_>
  unsigned long read(Protocol_* iprot);
  template <class Protocol_>
  uint32_t serializedSize(Protocol_ const* prot_) const;
  template <class Protocol_>
  uint32_t serializedSizeZC(Protocol_ const* prot_) const;
  template <class Protocol_>
  uint32_t write(Protocol_* prot_) const;

 private:
  template <class Protocol_>
  void readNoXfer(Protocol_* iprot);

  friend class ::apache::thrift::Cpp2Ops<FractionStruct>;
  friend void swap(FractionStruct& a, FractionStruct& b);
};

template <class Protocol_>
unsigned long FractionStruct::read(Protocol_* iprot) {
  auto _xferStart = iprot->getCursorPosition();
  readNoXfer(iprot);
  return iprot->getCursorPosition() - _xferStart;
}


class ProtocolUnion final  {
 private:
  friend struct ::apache::thrift::detail::st::struct_private_access;
  template<class> friend struct ::apache::thrift::detail::invoke_reffer;

  //  used by a static_assert in the corresponding source
  static constexpr bool __fbthrift_cpp2_gen_json = false;
  static const char* __fbthrift_thrift_uri();
  static const folly::StringPiece __fbthrift_get_field_name(::apache::thrift::FieldOrdinal ord);
  static constexpr std::size_t __fbthrift_field_size_v = 3;

  template<class T>
  using __fbthrift_id = folly::type_pack_element_t<folly::to_underlying(T::value),
                                                   void,
                                                   ::apache::thrift::field_id<1>,
                                                   ::apache::thrift::field_id<2>,
                                                   ::apache::thrift::field_id<3>>;

  template<class T>
  using __fbthrift_type_tag = folly::type_pack_element_t<folly::to_underlying(T::value),
                                                         void,
                                                         ::apache::thrift::type::enum_t<::apache::thrift::type::StandardProtocol>,
                                                         ::apache::thrift::type::string_t,
                                                         ::apache::thrift::type::i64_t>;

  template<class T>
  using __fbthrift_ident = folly::type_pack_element_t<folly::to_underlying(T::value),
                                                      void,
                                                      ::apache::thrift::tag::standard,
                                                      ::apache::thrift::tag::custom,
                                                      ::apache::thrift::tag::id>;

  struct __fbthrift_ordinal_impl {
#if defined(_MSC_VER) || defined(__clang__)
    template<class> static constexpr int value = 0;
    template<> static constexpr int value<::apache::thrift::field_id<1>> = 1;
    template<> static constexpr int value<::apache::thrift::tag::standard> = 1;
    template<> static constexpr int value<::apache::thrift::field_id<2>> = 2;
    template<> static constexpr int value<::apache::thrift::tag::custom> = 2;
    template<> static constexpr int value<::apache::thrift::field_id<3>> = 3;
    template<> static constexpr int value<::apache::thrift::tag::id> = 3;
#else
    template<class T> static constexpr int value_impl(folly::tag_t<T>) { return 0; }
    static constexpr int value_impl(folly::tag_t<::apache::thrift::field_id<1>>) { return 1; }
    static constexpr int value_impl(folly::tag_t<::apache::thrift::tag::standard>) { return 1; }
    static constexpr int value_impl(folly::tag_t<::apache::thrift::field_id<2>>) { return 2; }
    static constexpr int value_impl(folly::tag_t<::apache::thrift::tag::custom>) { return 2; }
    static constexpr int value_impl(folly::tag_t<::apache::thrift::field_id<3>>) { return 3; }
    static constexpr int value_impl(folly::tag_t<::apache::thrift::tag::id>) { return 3; }
    template<class T> static constexpr int value = value_impl(folly::tag_t<T>{});
#endif
  };

  struct __fbthrift_ordinal_impl_for_non_unique_type {
    template<class, class, class> struct Impl { static constexpr int value = 0; };
    template<class T> struct Impl<::apache::thrift::type::enum_t<::apache::thrift::type::StandardProtocol>, T, std::enable_if_t<sizeof(T) != -1>> { static constexpr int value = 1; };
    template<class T> struct Impl<::apache::thrift::type::string_t, T, std::enable_if_t<sizeof(T) != -2>> { static constexpr int value = 2; };
    template<class T> struct Impl<::apache::thrift::type::i64_t, T, std::enable_if_t<sizeof(T) != -3>> { static constexpr int value = 3; };

    template<class T> static constexpr int value = Impl<T, T, void>::value;
  };

  template<class T> using __fbthrift_ordinal = ::apache::thrift::field_ordinal<
    std::conditional_t<
        __fbthrift_ordinal_impl::value<T> != 0,
        __fbthrift_ordinal_impl,
        __fbthrift_ordinal_impl_for_non_unique_type>::template value<T>
  >;

  void __fbthrift_clear();
  void __fbthrift_clear_terse_fields();
  bool __fbthrift_is_empty() const;

 public:
  using __fbthrift_cpp2_type = ProtocolUnion;
  static constexpr bool __fbthrift_cpp2_is_union =
    true;


 public:
  enum Type : int {
    __EMPTY__ = 0,
    standard = 1,
    custom = 2,
    id = 3,
  } ;

  ProtocolUnion()
      : type_(folly::to_underlying(Type::__EMPTY__)) {}

  ProtocolUnion(ProtocolUnion&& rhs) noexcept
      : type_(folly::to_underlying(Type::__EMPTY__)) {
    if (this == &rhs) { return; }
    if (rhs.getType() == Type::__EMPTY__) { return; }
    switch (rhs.getType()) {
      case Type::standard:
      {
        set_standard(std::move(rhs.value_.standard));
        break;
      }
      case Type::custom:
      {
        set_custom(std::move(rhs.value_.custom));
        break;
      }
      case Type::id:
      {
        set_id(std::move(rhs.value_.id));
        break;
      }
      default:
      {
        assert(false);
        break;
      }
    }
    apache::thrift::clear(rhs);
  }

  ProtocolUnion(const ProtocolUnion& rhs)
      : type_(folly::to_underlying(Type::__EMPTY__)) {
    if (this == &rhs) { return; }
    if (rhs.getType() == Type::__EMPTY__) { return; }
    switch (rhs.getType()) {
      case Type::standard:
      {
        set_standard(rhs.value_.standard);
        break;
      }
      case Type::custom:
      {
        set_custom(rhs.value_.custom);
        break;
      }
      case Type::id:
      {
        set_id(rhs.value_.id);
        break;
      }
      default:
      {
        assert(false);
        break;
      }
    }
  }

  ProtocolUnion& operator=(ProtocolUnion&& rhs) noexcept {
    if (this == &rhs) { return *this; }
    __fbthrift_clear();
    if (rhs.getType() == Type::__EMPTY__) { return *this; }
    switch (rhs.getType()) {
      case Type::standard:
      {
        set_standard(std::move(rhs.value_.standard));
        break;
      }
      case Type::custom:
      {
        set_custom(std::move(rhs.value_.custom));
        break;
      }
      case Type::id:
      {
        set_id(std::move(rhs.value_.id));
        break;
      }
      default:
      {
        assert(false);
        break;
      }
    }
    apache::thrift::clear(rhs);
    return *this;
  }

  ProtocolUnion& operator=(const ProtocolUnion& rhs) {
    if (this == &rhs) { return *this; }
    __fbthrift_clear();
    if (rhs.getType() == Type::__EMPTY__) { return *this; }
    switch (rhs.getType()) {
      case Type::standard:
      {
        set_standard(rhs.value_.standard);
        break;
      }
      case Type::custom:
      {
        set_custom(rhs.value_.custom);
        break;
      }
      case Type::id:
      {
        set_id(rhs.value_.id);
        break;
      }
      default:
      {
        assert(false);
        break;
      }
    }
    return *this;
  }

  ~ProtocolUnion() {
    apache::thrift::clear(*this);
  }

  union storage_type {
    ::apache::thrift::type::StandardProtocol standard;
    ::apache::thrift::type::Uri custom;
    ::apache::thrift::type::ProtocolId id;

    storage_type() {}
    ~storage_type() {}
  } ;

  bool operator==(const ProtocolUnion&) const;
  bool operator<(const ProtocolUnion&) const;

  ::apache::thrift::type::StandardProtocol& set_standard(::apache::thrift::type::StandardProtocol t = ::apache::thrift::type::StandardProtocol()) {
    __fbthrift_clear();
    type_ = folly::to_underlying(Type::standard);
    ::new (std::addressof(value_.standard)) ::apache::thrift::type::StandardProtocol(t);
    return value_.standard;
  }

  ::apache::thrift::type::Uri& set_custom(::apache::thrift::type::Uri const &t) {
    __fbthrift_clear();
    type_ = folly::to_underlying(Type::custom);
    ::new (std::addressof(value_.custom)) ::apache::thrift::type::Uri(t);
    return value_.custom;
  }

  ::apache::thrift::type::Uri& set_custom(::apache::thrift::type::Uri&& t) {
    __fbthrift_clear();
    type_ = folly::to_underlying(Type::custom);
    ::new (std::addressof(value_.custom)) ::apache::thrift::type::Uri(std::move(t));
    return value_.custom;
  }

  template<typename... T, typename = ::apache::thrift::safe_overload_t<::apache::thrift::type::Uri, T...>> ::apache::thrift::type::Uri& set_custom(T&&... t) {
    __fbthrift_clear();
    type_ = folly::to_underlying(Type::custom);
    ::new (std::addressof(value_.custom)) ::apache::thrift::type::Uri(std::forward<T>(t)...);
    return value_.custom;
  }

  ::apache::thrift::type::ProtocolId& set_id(::apache::thrift::type::ProtocolId t = ::apache::thrift::type::ProtocolId()) {
    __fbthrift_clear();
    type_ = folly::to_underlying(Type::id);
    ::new (std::addressof(value_.id)) ::apache::thrift::type::ProtocolId(t);
    return value_.id;
  }

  ::apache::thrift::type::StandardProtocol const& get_standard() const {
    if (getType() != Type::standard) {
      ::apache::thrift::detail::throw_on_bad_field_access();
    }
    return value_.standard;
  }

  ::apache::thrift::type::Uri const& get_custom() const {
    if (getType() != Type::custom) {
      ::apache::thrift::detail::throw_on_bad_field_access();
    }
    return value_.custom;
  }

  ::apache::thrift::type::ProtocolId const& get_id() const {
    if (getType() != Type::id) {
      ::apache::thrift::detail::throw_on_bad_field_access();
    }
    return value_.id;
  }

  ::apache::thrift::type::StandardProtocol& mutable_standard() {
    assert(getType() == Type::standard);
    return value_.standard;
  }

  ::apache::thrift::type::Uri& mutable_custom() {
    assert(getType() == Type::custom);
    return value_.custom;
  }

  ::apache::thrift::type::ProtocolId& mutable_id() {
    assert(getType() == Type::id);
    return value_.id;
  }

  ::apache::thrift::type::StandardProtocol move_standard() {
    assert(getType() == Type::standard);
    return std::move(value_.standard);
  }

  ::apache::thrift::type::Uri move_custom() {
    assert(getType() == Type::custom);
    return std::move(value_.custom);
  }

  ::apache::thrift::type::ProtocolId move_id() {
    assert(getType() == Type::id);
    return std::move(value_.id);
  }

  template <typename..., typename T = ::apache::thrift::type::StandardProtocol>
  FOLLY_ERASE ::apache::thrift::union_field_ref<const T&> standard_ref() const& {
    return {value_.standard, type_, folly::to_underlying(Type::standard), this, ::apache::thrift::detail::union_field_ref_owner_vtable_for<decltype(*this)>};
  }

  template <typename..., typename T = ::apache::thrift::type::StandardProtocol>
  FOLLY_ERASE ::apache::thrift::union_field_ref<const T&&> standard_ref() const&& {
    return {std::move(value_.standard), type_, folly::to_underlying(Type::standard), this, ::apache::thrift::detail::union_field_ref_owner_vtable_for<decltype(*this)>};
  }

  template <typename..., typename T = ::apache::thrift::type::StandardProtocol>
  FOLLY_ERASE ::apache::thrift::union_field_ref<T&> standard_ref() & {
    return {value_.standard, type_, folly::to_underlying(Type::standard), this, ::apache::thrift::detail::union_field_ref_owner_vtable_for<decltype(*this)>};
  }

  template <typename..., typename T = ::apache::thrift::type::StandardProtocol>
  FOLLY_ERASE ::apache::thrift::union_field_ref<T&&> standard_ref() && {
    return {std::move(value_.standard), type_, folly::to_underlying(Type::standard), this, ::apache::thrift::detail::union_field_ref_owner_vtable_for<decltype(*this)>};
  }
  template <typename..., typename T = ::apache::thrift::type::Uri>
  FOLLY_ERASE ::apache::thrift::union_field_ref<const T&> custom_ref() const& {
    return {value_.custom, type_, folly::to_underlying(Type::custom), this, ::apache::thrift::detail::union_field_ref_owner_vtable_for<decltype(*this)>};
  }

  template <typename..., typename T = ::apache::thrift::type::Uri>
  FOLLY_ERASE ::apache::thrift::union_field_ref<const T&&> custom_ref() const&& {
    return {std::move(value_.custom), type_, folly::to_underlying(Type::custom), this, ::apache::thrift::detail::union_field_ref_owner_vtable_for<decltype(*this)>};
  }

  template <typename..., typename T = ::apache::thrift::type::Uri>
  FOLLY_ERASE ::apache::thrift::union_field_ref<T&> custom_ref() & {
    return {value_.custom, type_, folly::to_underlying(Type::custom), this, ::apache::thrift::detail::union_field_ref_owner_vtable_for<decltype(*this)>};
  }

  template <typename..., typename T = ::apache::thrift::type::Uri>
  FOLLY_ERASE ::apache::thrift::union_field_ref<T&&> custom_ref() && {
    return {std::move(value_.custom), type_, folly::to_underlying(Type::custom), this, ::apache::thrift::detail::union_field_ref_owner_vtable_for<decltype(*this)>};
  }
  template <typename..., typename T = ::apache::thrift::type::ProtocolId>
  FOLLY_ERASE ::apache::thrift::union_field_ref<const T&> id_ref() const& {
    return {value_.id, type_, folly::to_underlying(Type::id), this, ::apache::thrift::detail::union_field_ref_owner_vtable_for<decltype(*this)>};
  }

  template <typename..., typename T = ::apache::thrift::type::ProtocolId>
  FOLLY_ERASE ::apache::thrift::union_field_ref<const T&&> id_ref() const&& {
    return {std::move(value_.id), type_, folly::to_underlying(Type::id), this, ::apache::thrift::detail::union_field_ref_owner_vtable_for<decltype(*this)>};
  }

  template <typename..., typename T = ::apache::thrift::type::ProtocolId>
  FOLLY_ERASE ::apache::thrift::union_field_ref<T&> id_ref() & {
    return {value_.id, type_, folly::to_underlying(Type::id), this, ::apache::thrift::detail::union_field_ref_owner_vtable_for<decltype(*this)>};
  }

  template <typename..., typename T = ::apache::thrift::type::ProtocolId>
  FOLLY_ERASE ::apache::thrift::union_field_ref<T&&> id_ref() && {
    return {std::move(value_.id), type_, folly::to_underlying(Type::id), this, ::apache::thrift::detail::union_field_ref_owner_vtable_for<decltype(*this)>};
  }
  Type getType() const { return static_cast<Type>(type_); }

  template <class Protocol_>
  unsigned long read(Protocol_* iprot);
  template <class Protocol_>
  uint32_t serializedSize(Protocol_ const* prot_) const;
  template <class Protocol_>
  uint32_t serializedSizeZC(Protocol_ const* prot_) const;
  template <class Protocol_>
  uint32_t write(Protocol_* prot_) const;
 protected:
  template <class T>
  void destruct(T &val) {
    (&val)->~T();
  }

  storage_type value_;
  std::underlying_type_t<Type> type_;

 private:
  template <class Protocol_>
  void readNoXfer(Protocol_* iprot);

  friend class ::apache::thrift::Cpp2Ops<ProtocolUnion>;
  friend void swap(ProtocolUnion& a, ProtocolUnion& b);
};

template <class Protocol_>
unsigned long ProtocolUnion::read(Protocol_* iprot) {
  auto _xferStart = iprot->getCursorPosition();
  readNoXfer(iprot);
  return iprot->getCursorPosition() - _xferStart;
}


class TypeStruct final  {
 private:
  friend struct ::apache::thrift::detail::st::struct_private_access;
  template<class> friend struct ::apache::thrift::detail::invoke_reffer;

  //  used by a static_assert in the corresponding source
  static constexpr bool __fbthrift_cpp2_gen_json = false;
  static const char* __fbthrift_thrift_uri();
  static const folly::StringPiece __fbthrift_get_field_name(::apache::thrift::FieldOrdinal ord);
  static constexpr std::size_t __fbthrift_field_size_v = 2;

  template<class T>
  using __fbthrift_id = folly::type_pack_element_t<folly::to_underlying(T::value),
                                                   void,
                                                   ::apache::thrift::field_id<1>,
                                                   ::apache::thrift::field_id<2>>;

  template<class T>
  using __fbthrift_type_tag = folly::type_pack_element_t<folly::to_underlying(T::value),
                                                         void,
                                                         ::apache::thrift::type::union_t<::apache::thrift::type::TypeName>,
                                                         ::apache::thrift::type::list<::apache::thrift::type::struct_t<::apache::thrift::type::TypeStruct>>>;

  template<class T>
  using __fbthrift_ident = folly::type_pack_element_t<folly::to_underlying(T::value),
                                                      void,
                                                      ::apache::thrift::tag::name,
                                                      ::apache::thrift::tag::params>;

  struct __fbthrift_ordinal_impl {
#if defined(_MSC_VER) || defined(__clang__)
    template<class> static constexpr int value = 0;
    template<> static constexpr int value<::apache::thrift::field_id<1>> = 1;
    template<> static constexpr int value<::apache::thrift::tag::name> = 1;
    template<> static constexpr int value<::apache::thrift::field_id<2>> = 2;
    template<> static constexpr int value<::apache::thrift::tag::params> = 2;
#else
    template<class T> static constexpr int value_impl(folly::tag_t<T>) { return 0; }
    static constexpr int value_impl(folly::tag_t<::apache::thrift::field_id<1>>) { return 1; }
    static constexpr int value_impl(folly::tag_t<::apache::thrift::tag::name>) { return 1; }
    static constexpr int value_impl(folly::tag_t<::apache::thrift::field_id<2>>) { return 2; }
    static constexpr int value_impl(folly::tag_t<::apache::thrift::tag::params>) { return 2; }
    template<class T> static constexpr int value = value_impl(folly::tag_t<T>{});
#endif
  };

  struct __fbthrift_ordinal_impl_for_non_unique_type {
    template<class, class, class> struct Impl { static constexpr int value = 0; };
    template<class T> struct Impl<::apache::thrift::type::union_t<::apache::thrift::type::TypeName>, T, std::enable_if_t<sizeof(T) != -1>> { static constexpr int value = 1; };
    template<class T> struct Impl<::apache::thrift::type::list<::apache::thrift::type::struct_t<::apache::thrift::type::TypeStruct>>, T, std::enable_if_t<sizeof(T) != -2>> { static constexpr int value = 2; };

    template<class T> static constexpr int value = Impl<T, T, void>::value;
  };

  template<class T> using __fbthrift_ordinal = ::apache::thrift::field_ordinal<
    std::conditional_t<
        __fbthrift_ordinal_impl::value<T> != 0,
        __fbthrift_ordinal_impl,
        __fbthrift_ordinal_impl_for_non_unique_type>::template value<T>
  >;

  void __fbthrift_clear();
  void __fbthrift_clear_terse_fields();
  bool __fbthrift_is_empty() const;

 public:
  using __fbthrift_cpp2_type = TypeStruct;
  static constexpr bool __fbthrift_cpp2_is_union =
    false;


 public:

  TypeStruct() {
  }
  // FragileConstructor for use in initialization lists only.
  [[deprecated("This constructor is deprecated")]]
  TypeStruct(apache::thrift::FragileConstructor, ::apache::thrift::type::TypeName name__arg, ::std::vector<::apache::thrift::type::TypeStruct> params__arg);

  TypeStruct(TypeStruct&&) noexcept;

  TypeStruct(const TypeStruct& src);


  TypeStruct& operator=(TypeStruct&&) noexcept;
  TypeStruct& operator=(const TypeStruct& src);
 private:
  ::apache::thrift::type::TypeName __fbthrift_field_name;
 private:
  ::std::vector<::apache::thrift::type::TypeStruct> __fbthrift_field_params;
 private:
  apache::thrift::detail::isset_bitset<2, apache::thrift::detail::IssetBitsetOption::Unpacked> __isset;

 public:

  bool operator==(const TypeStruct&) const;
  bool operator<(const TypeStruct&) const;

  template <typename..., typename T = ::apache::thrift::type::TypeName>
  FOLLY_ERASE ::apache::thrift::field_ref<const T&> name_ref() const& {
    return {this->__fbthrift_field_name, __isset.at(0), __isset.bit(0)};
  }

  template <typename..., typename T = ::apache::thrift::type::TypeName>
  FOLLY_ERASE ::apache::thrift::field_ref<const T&&> name_ref() const&& {
    return {static_cast<const T&&>(this->__fbthrift_field_name), __isset.at(0), __isset.bit(0)};
  }

  template <typename..., typename T = ::apache::thrift::type::TypeName>
  FOLLY_ERASE ::apache::thrift::field_ref<T&> name_ref() & {
    return {this->__fbthrift_field_name, __isset.at(0), __isset.bit(0)};
  }

  template <typename..., typename T = ::apache::thrift::type::TypeName>
  FOLLY_ERASE ::apache::thrift::field_ref<T&&> name_ref() && {
    return {static_cast<T&&>(this->__fbthrift_field_name), __isset.at(0), __isset.bit(0)};
  }

  template <typename..., typename T = ::apache::thrift::type::TypeName>
  FOLLY_ERASE ::apache::thrift::field_ref<const T&> name() const& {
    return {this->__fbthrift_field_name, __isset.at(0), __isset.bit(0)};
  }

  template <typename..., typename T = ::apache::thrift::type::TypeName>
  FOLLY_ERASE ::apache::thrift::field_ref<const T&&> name() const&& {
    return {static_cast<const T&&>(this->__fbthrift_field_name), __isset.at(0), __isset.bit(0)};
  }

  template <typename..., typename T = ::apache::thrift::type::TypeName>
  FOLLY_ERASE ::apache::thrift::field_ref<T&> name() & {
    return {this->__fbthrift_field_name, __isset.at(0), __isset.bit(0)};
  }

  template <typename..., typename T = ::apache::thrift::type::TypeName>
  FOLLY_ERASE ::apache::thrift::field_ref<T&&> name() && {
    return {static_cast<T&&>(this->__fbthrift_field_name), __isset.at(0), __isset.bit(0)};
  }

  template <typename..., typename T = ::std::vector<::apache::thrift::type::TypeStruct>>
  FOLLY_ERASE ::apache::thrift::field_ref<const T&> params_ref() const& {
    return {this->__fbthrift_field_params, __isset.at(1), __isset.bit(1)};
  }

  template <typename..., typename T = ::std::vector<::apache::thrift::type::TypeStruct>>
  FOLLY_ERASE ::apache::thrift::field_ref<const T&&> params_ref() const&& {
    return {static_cast<const T&&>(this->__fbthrift_field_params), __isset.at(1), __isset.bit(1)};
  }

  template <typename..., typename T = ::std::vector<::apache::thrift::type::TypeStruct>>
  FOLLY_ERASE ::apache::thrift::field_ref<T&> params_ref() & {
    return {this->__fbthrift_field_params, __isset.at(1), __isset.bit(1)};
  }

  template <typename..., typename T = ::std::vector<::apache::thrift::type::TypeStruct>>
  FOLLY_ERASE ::apache::thrift::field_ref<T&&> params_ref() && {
    return {static_cast<T&&>(this->__fbthrift_field_params), __isset.at(1), __isset.bit(1)};
  }

  template <typename..., typename T = ::std::vector<::apache::thrift::type::TypeStruct>>
  FOLLY_ERASE ::apache::thrift::field_ref<const T&> params() const& {
    return {this->__fbthrift_field_params, __isset.at(1), __isset.bit(1)};
  }

  template <typename..., typename T = ::std::vector<::apache::thrift::type::TypeStruct>>
  FOLLY_ERASE ::apache::thrift::field_ref<const T&&> params() const&& {
    return {static_cast<const T&&>(this->__fbthrift_field_params), __isset.at(1), __isset.bit(1)};
  }

  template <typename..., typename T = ::std::vector<::apache::thrift::type::TypeStruct>>
  FOLLY_ERASE ::apache::thrift::field_ref<T&> params() & {
    return {this->__fbthrift_field_params, __isset.at(1), __isset.bit(1)};
  }

  template <typename..., typename T = ::std::vector<::apache::thrift::type::TypeStruct>>
  FOLLY_ERASE ::apache::thrift::field_ref<T&&> params() && {
    return {static_cast<T&&>(this->__fbthrift_field_params), __isset.at(1), __isset.bit(1)};
  }
  const ::apache::thrift::type::TypeName& get_name() const&;
  ::apache::thrift::type::TypeName get_name() &&;

  template <typename T_TypeStruct_name_struct_setter = ::apache::thrift::type::TypeName>
  [[deprecated("Use `FOO.name_ref() = BAR;` instead of `FOO.set_name(BAR);`")]]
  ::apache::thrift::type::TypeName& set_name(T_TypeStruct_name_struct_setter&& name_) {
    name_ref() = std::forward<T_TypeStruct_name_struct_setter>(name_);
    return __fbthrift_field_name;
  }
  const ::std::vector<::apache::thrift::type::TypeStruct>& get_params() const&;
  ::std::vector<::apache::thrift::type::TypeStruct> get_params() &&;

  template <typename T_TypeStruct_params_struct_setter = ::std::vector<::apache::thrift::type::TypeStruct>>
  [[deprecated("Use `FOO.params_ref() = BAR;` instead of `FOO.set_params(BAR);`")]]
  ::std::vector<::apache::thrift::type::TypeStruct>& set_params(T_TypeStruct_params_struct_setter&& params_) {
    params_ref() = std::forward<T_TypeStruct_params_struct_setter>(params_);
    return __fbthrift_field_params;
  }

  template <class Protocol_>
  unsigned long read(Protocol_* iprot);
  template <class Protocol_>
  uint32_t serializedSize(Protocol_ const* prot_) const;
  template <class Protocol_>
  uint32_t serializedSizeZC(Protocol_ const* prot_) const;
  template <class Protocol_>
  uint32_t write(Protocol_* prot_) const;

 private:
  template <class Protocol_>
  void readNoXfer(Protocol_* iprot);

  friend class ::apache::thrift::Cpp2Ops<TypeStruct>;
  friend void swap(TypeStruct& a, TypeStruct& b);
};

template <class Protocol_>
unsigned long TypeStruct::read(Protocol_* iprot) {
  auto _xferStart = iprot->getCursorPosition();
  readNoXfer(iprot);
  return iprot->getCursorPosition() - _xferStart;
}


class SourceLocation final  {
 private:
  friend struct ::apache::thrift::detail::st::struct_private_access;
  template<class> friend struct ::apache::thrift::detail::invoke_reffer;

  //  used by a static_assert in the corresponding source
  static constexpr bool __fbthrift_cpp2_gen_json = false;
  static const char* __fbthrift_thrift_uri();
  static const folly::StringPiece __fbthrift_get_field_name(::apache::thrift::FieldOrdinal ord);
  static constexpr std::size_t __fbthrift_field_size_v = 4;

  template<class T>
  using __fbthrift_id = folly::type_pack_element_t<folly::to_underlying(T::value),
                                                   void,
                                                   ::apache::thrift::field_id<1>,
                                                   ::apache::thrift::field_id<2>,
                                                   ::apache::thrift::field_id<3>,
                                                   ::apache::thrift::field_id<4>>;

  template<class T>
  using __fbthrift_type_tag = folly::type_pack_element_t<folly::to_underlying(T::value),
                                                         void,
                                                         ::apache::thrift::type::i64_t,
                                                         ::apache::thrift::type::i32_t,
                                                         ::apache::thrift::type::i32_t,
                                                         ::apache::thrift::type::i32_t>;

  template<class T>
  using __fbthrift_ident = folly::type_pack_element_t<folly::to_underlying(T::value),
                                                      void,
                                                      ::apache::thrift::tag::source,
                                                      ::apache::thrift::tag::offset,
                                                      ::apache::thrift::tag::line,
                                                      ::apache::thrift::tag::col>;

  struct __fbthrift_ordinal_impl {
#if defined(_MSC_VER) || defined(__clang__)
    template<class> static constexpr int value = 0;
    template<> static constexpr int value<::apache::thrift::field_id<1>> = 1;
    template<> static constexpr int value<::apache::thrift::tag::source> = 1;
    template<> static constexpr int value<::apache::thrift::field_id<2>> = 2;
    template<> static constexpr int value<::apache::thrift::tag::offset> = 2;
    template<> static constexpr int value<::apache::thrift::field_id<3>> = 3;
    template<> static constexpr int value<::apache::thrift::tag::line> = 3;
    template<> static constexpr int value<::apache::thrift::field_id<4>> = 4;
    template<> static constexpr int value<::apache::thrift::tag::col> = 4;
#else
    template<class T> static constexpr int value_impl(folly::tag_t<T>) { return 0; }
    static constexpr int value_impl(folly::tag_t<::apache::thrift::field_id<1>>) { return 1; }
    static constexpr int value_impl(folly::tag_t<::apache::thrift::tag::source>) { return 1; }
    static constexpr int value_impl(folly::tag_t<::apache::thrift::field_id<2>>) { return 2; }
    static constexpr int value_impl(folly::tag_t<::apache::thrift::tag::offset>) { return 2; }
    static constexpr int value_impl(folly::tag_t<::apache::thrift::field_id<3>>) { return 3; }
    static constexpr int value_impl(folly::tag_t<::apache::thrift::tag::line>) { return 3; }
    static constexpr int value_impl(folly::tag_t<::apache::thrift::field_id<4>>) { return 4; }
    static constexpr int value_impl(folly::tag_t<::apache::thrift::tag::col>) { return 4; }
    template<class T> static constexpr int value = value_impl(folly::tag_t<T>{});
#endif
  };

  struct __fbthrift_ordinal_impl_for_non_unique_type {
    template<class, class, class> struct Impl { static constexpr int value = 0; };
    template<class T> struct Impl<::apache::thrift::type::i64_t, T, std::enable_if_t<sizeof(T) != -1>> { static constexpr int value = 1; };
    template<class T> struct Impl<::apache::thrift::type::i32_t, T, std::enable_if_t<sizeof(T) != -2>> { static constexpr int value = 2; };
    template<class T> struct Impl<::apache::thrift::type::i32_t, T, std::enable_if_t<sizeof(T) != -3>> { static constexpr int value = 3; };
    template<class T> struct Impl<::apache::thrift::type::i32_t, T, std::enable_if_t<sizeof(T) != -4>> { static constexpr int value = 4; };

    template<class T> static constexpr int value = Impl<T, T, void>::value;
  };

  template<class T> using __fbthrift_ordinal = ::apache::thrift::field_ordinal<
    std::conditional_t<
        __fbthrift_ordinal_impl::value<T> != 0,
        __fbthrift_ordinal_impl,
        __fbthrift_ordinal_impl_for_non_unique_type>::template value<T>
  >;

  void __fbthrift_clear();
  void __fbthrift_clear_terse_fields();
  bool __fbthrift_is_empty() const;

 public:
  using __fbthrift_cpp2_type = SourceLocation;
  static constexpr bool __fbthrift_cpp2_is_union =
    false;


 public:

  SourceLocation() :
      __fbthrift_field_source(),
      __fbthrift_field_offset(),
      __fbthrift_field_line(),
      __fbthrift_field_col() {
  }
  // FragileConstructor for use in initialization lists only.
  [[deprecated("This constructor is deprecated")]]
  SourceLocation(apache::thrift::FragileConstructor, ::apache::thrift::type::SourceId source__arg, ::std::int32_t offset__arg, ::std::int32_t line__arg, ::std::int32_t col__arg);

  SourceLocation(SourceLocation&&) noexcept;

  SourceLocation(const SourceLocation& src);


  SourceLocation& operator=(SourceLocation&&) noexcept;
  SourceLocation& operator=(const SourceLocation& src);
 private:
  ::apache::thrift::type::SourceId __fbthrift_field_source;
 private:
  ::std::int32_t __fbthrift_field_offset;
 private:
  ::std::int32_t __fbthrift_field_line;
 private:
  ::std::int32_t __fbthrift_field_col;
 private:
  apache::thrift::detail::isset_bitset<4, apache::thrift::detail::IssetBitsetOption::Unpacked> __isset;

 public:

  bool operator==(const SourceLocation&) const;
  bool operator<(const SourceLocation&) const;

  template <typename..., typename T = ::apache::thrift::type::SourceId>
  FOLLY_ERASE ::apache::thrift::field_ref<const T&> source_ref() const& {
    return {this->__fbthrift_field_source, __isset.at(0), __isset.bit(0)};
  }

  template <typename..., typename T = ::apache::thrift::type::SourceId>
  FOLLY_ERASE ::apache::thrift::field_ref<const T&&> source_ref() const&& {
    return {static_cast<const T&&>(this->__fbthrift_field_source), __isset.at(0), __isset.bit(0)};
  }

  template <typename..., typename T = ::apache::thrift::type::SourceId>
  FOLLY_ERASE ::apache::thrift::field_ref<T&> source_ref() & {
    return {this->__fbthrift_field_source, __isset.at(0), __isset.bit(0)};
  }

  template <typename..., typename T = ::apache::thrift::type::SourceId>
  FOLLY_ERASE ::apache::thrift::field_ref<T&&> source_ref() && {
    return {static_cast<T&&>(this->__fbthrift_field_source), __isset.at(0), __isset.bit(0)};
  }

  template <typename..., typename T = ::apache::thrift::type::SourceId>
  FOLLY_ERASE ::apache::thrift::field_ref<const T&> source() const& {
    return {this->__fbthrift_field_source, __isset.at(0), __isset.bit(0)};
  }

  template <typename..., typename T = ::apache::thrift::type::SourceId>
  FOLLY_ERASE ::apache::thrift::field_ref<const T&&> source() const&& {
    return {static_cast<const T&&>(this->__fbthrift_field_source), __isset.at(0), __isset.bit(0)};
  }

  template <typename..., typename T = ::apache::thrift::type::SourceId>
  FOLLY_ERASE ::apache::thrift::field_ref<T&> source() & {
    return {this->__fbthrift_field_source, __isset.at(0), __isset.bit(0)};
  }

  template <typename..., typename T = ::apache::thrift::type::SourceId>
  FOLLY_ERASE ::apache::thrift::field_ref<T&&> source() && {
    return {static_cast<T&&>(this->__fbthrift_field_source), __isset.at(0), __isset.bit(0)};
  }

  template <typename..., typename T = ::std::int32_t>
  FOLLY_ERASE ::apache::thrift::field_ref<const T&> offset_ref() const& {
    return {this->__fbthrift_field_offset, __isset.at(1), __isset.bit(1)};
  }

  template <typename..., typename T = ::std::int32_t>
  FOLLY_ERASE ::apache::thrift::field_ref<const T&&> offset_ref() const&& {
    return {static_cast<const T&&>(this->__fbthrift_field_offset), __isset.at(1), __isset.bit(1)};
  }

  template <typename..., typename T = ::std::int32_t>
  FOLLY_ERASE ::apache::thrift::field_ref<T&> offset_ref() & {
    return {this->__fbthrift_field_offset, __isset.at(1), __isset.bit(1)};
  }

  template <typename..., typename T = ::std::int32_t>
  FOLLY_ERASE ::apache::thrift::field_ref<T&&> offset_ref() && {
    return {static_cast<T&&>(this->__fbthrift_field_offset), __isset.at(1), __isset.bit(1)};
  }

  template <typename..., typename T = ::std::int32_t>
  FOLLY_ERASE ::apache::thrift::field_ref<const T&> offset() const& {
    return {this->__fbthrift_field_offset, __isset.at(1), __isset.bit(1)};
  }

  template <typename..., typename T = ::std::int32_t>
  FOLLY_ERASE ::apache::thrift::field_ref<const T&&> offset() const&& {
    return {static_cast<const T&&>(this->__fbthrift_field_offset), __isset.at(1), __isset.bit(1)};
  }

  template <typename..., typename T = ::std::int32_t>
  FOLLY_ERASE ::apache::thrift::field_ref<T&> offset() & {
    return {this->__fbthrift_field_offset, __isset.at(1), __isset.bit(1)};
  }

  template <typename..., typename T = ::std::int32_t>
  FOLLY_ERASE ::apache::thrift::field_ref<T&&> offset() && {
    return {static_cast<T&&>(this->__fbthrift_field_offset), __isset.at(1), __isset.bit(1)};
  }

  template <typename..., typename T = ::std::int32_t>
  FOLLY_ERASE ::apache::thrift::field_ref<const T&> line_ref() const& {
    return {this->__fbthrift_field_line, __isset.at(2), __isset.bit(2)};
  }

  template <typename..., typename T = ::std::int32_t>
  FOLLY_ERASE ::apache::thrift::field_ref<const T&&> line_ref() const&& {
    return {static_cast<const T&&>(this->__fbthrift_field_line), __isset.at(2), __isset.bit(2)};
  }

  template <typename..., typename T = ::std::int32_t>
  FOLLY_ERASE ::apache::thrift::field_ref<T&> line_ref() & {
    return {this->__fbthrift_field_line, __isset.at(2), __isset.bit(2)};
  }

  template <typename..., typename T = ::std::int32_t>
  FOLLY_ERASE ::apache::thrift::field_ref<T&&> line_ref() && {
    return {static_cast<T&&>(this->__fbthrift_field_line), __isset.at(2), __isset.bit(2)};
  }

  template <typename..., typename T = ::std::int32_t>
  FOLLY_ERASE ::apache::thrift::field_ref<const T&> line() const& {
    return {this->__fbthrift_field_line, __isset.at(2), __isset.bit(2)};
  }

  template <typename..., typename T = ::std::int32_t>
  FOLLY_ERASE ::apache::thrift::field_ref<const T&&> line() const&& {
    return {static_cast<const T&&>(this->__fbthrift_field_line), __isset.at(2), __isset.bit(2)};
  }

  template <typename..., typename T = ::std::int32_t>
  FOLLY_ERASE ::apache::thrift::field_ref<T&> line() & {
    return {this->__fbthrift_field_line, __isset.at(2), __isset.bit(2)};
  }

  template <typename..., typename T = ::std::int32_t>
  FOLLY_ERASE ::apache::thrift::field_ref<T&&> line() && {
    return {static_cast<T&&>(this->__fbthrift_field_line), __isset.at(2), __isset.bit(2)};
  }

  template <typename..., typename T = ::std::int32_t>
  FOLLY_ERASE ::apache::thrift::field_ref<const T&> col_ref() const& {
    return {this->__fbthrift_field_col, __isset.at(3), __isset.bit(3)};
  }

  template <typename..., typename T = ::std::int32_t>
  FOLLY_ERASE ::apache::thrift::field_ref<const T&&> col_ref() const&& {
    return {static_cast<const T&&>(this->__fbthrift_field_col), __isset.at(3), __isset.bit(3)};
  }

  template <typename..., typename T = ::std::int32_t>
  FOLLY_ERASE ::apache::thrift::field_ref<T&> col_ref() & {
    return {this->__fbthrift_field_col, __isset.at(3), __isset.bit(3)};
  }

  template <typename..., typename T = ::std::int32_t>
  FOLLY_ERASE ::apache::thrift::field_ref<T&&> col_ref() && {
    return {static_cast<T&&>(this->__fbthrift_field_col), __isset.at(3), __isset.bit(3)};
  }

  template <typename..., typename T = ::std::int32_t>
  FOLLY_ERASE ::apache::thrift::field_ref<const T&> col() const& {
    return {this->__fbthrift_field_col, __isset.at(3), __isset.bit(3)};
  }

  template <typename..., typename T = ::std::int32_t>
  FOLLY_ERASE ::apache::thrift::field_ref<const T&&> col() const&& {
    return {static_cast<const T&&>(this->__fbthrift_field_col), __isset.at(3), __isset.bit(3)};
  }

  template <typename..., typename T = ::std::int32_t>
  FOLLY_ERASE ::apache::thrift::field_ref<T&> col() & {
    return {this->__fbthrift_field_col, __isset.at(3), __isset.bit(3)};
  }

  template <typename..., typename T = ::std::int32_t>
  FOLLY_ERASE ::apache::thrift::field_ref<T&&> col() && {
    return {static_cast<T&&>(this->__fbthrift_field_col), __isset.at(3), __isset.bit(3)};
  }

  ::apache::thrift::type::SourceId get_source() const {
    return __fbthrift_field_source;
  }

  [[deprecated("Use `FOO.source_ref() = BAR;` instead of `FOO.set_source(BAR);`")]]
  ::apache::thrift::type::SourceId& set_source(::apache::thrift::type::SourceId source_) {
    source_ref() = source_;
    return __fbthrift_field_source;
  }

  ::std::int32_t get_offset() const {
    return __fbthrift_field_offset;
  }

  [[deprecated("Use `FOO.offset_ref() = BAR;` instead of `FOO.set_offset(BAR);`")]]
  ::std::int32_t& set_offset(::std::int32_t offset_) {
    offset_ref() = offset_;
    return __fbthrift_field_offset;
  }

  ::std::int32_t get_line() const {
    return __fbthrift_field_line;
  }

  [[deprecated("Use `FOO.line_ref() = BAR;` instead of `FOO.set_line(BAR);`")]]
  ::std::int32_t& set_line(::std::int32_t line_) {
    line_ref() = line_;
    return __fbthrift_field_line;
  }

  ::std::int32_t get_col() const {
    return __fbthrift_field_col;
  }

  [[deprecated("Use `FOO.col_ref() = BAR;` instead of `FOO.set_col(BAR);`")]]
  ::std::int32_t& set_col(::std::int32_t col_) {
    col_ref() = col_;
    return __fbthrift_field_col;
  }

  template <class Protocol_>
  unsigned long read(Protocol_* iprot);
  template <class Protocol_>
  uint32_t serializedSize(Protocol_ const* prot_) const;
  template <class Protocol_>
  uint32_t serializedSizeZC(Protocol_ const* prot_) const;
  template <class Protocol_>
  uint32_t write(Protocol_* prot_) const;

 private:
  template <class Protocol_>
  void readNoXfer(Protocol_* iprot);

  friend class ::apache::thrift::Cpp2Ops<SourceLocation>;
  friend void swap(SourceLocation& a, SourceLocation& b);
};

template <class Protocol_>
unsigned long SourceLocation::read(Protocol_* iprot) {
  auto _xferStart = iprot->getCursorPosition();
  readNoXfer(iprot);
  return iprot->getCursorPosition() - _xferStart;
}


class SourceRange final  {
 private:
  friend struct ::apache::thrift::detail::st::struct_private_access;
  template<class> friend struct ::apache::thrift::detail::invoke_reffer;

  //  used by a static_assert in the corresponding source
  static constexpr bool __fbthrift_cpp2_gen_json = false;
  static const char* __fbthrift_thrift_uri();
  static const folly::StringPiece __fbthrift_get_field_name(::apache::thrift::FieldOrdinal ord);
  static constexpr std::size_t __fbthrift_field_size_v = 2;

  template<class T>
  using __fbthrift_id = folly::type_pack_element_t<folly::to_underlying(T::value),
                                                   void,
                                                   ::apache::thrift::field_id<1>,
                                                   ::apache::thrift::field_id<2>>;

  template<class T>
  using __fbthrift_type_tag = folly::type_pack_element_t<folly::to_underlying(T::value),
                                                         void,
                                                         ::apache::thrift::type::struct_t<::apache::thrift::type::SourceLocation>,
                                                         ::apache::thrift::type::struct_t<::apache::thrift::type::SourceLocation>>;

  template<class T>
  using __fbthrift_ident = folly::type_pack_element_t<folly::to_underlying(T::value),
                                                      void,
                                                      ::apache::thrift::tag::begin,
                                                      ::apache::thrift::tag::end>;

  struct __fbthrift_ordinal_impl {
#if defined(_MSC_VER) || defined(__clang__)
    template<class> static constexpr int value = 0;
    template<> static constexpr int value<::apache::thrift::field_id<1>> = 1;
    template<> static constexpr int value<::apache::thrift::tag::begin> = 1;
    template<> static constexpr int value<::apache::thrift::field_id<2>> = 2;
    template<> static constexpr int value<::apache::thrift::tag::end> = 2;
#else
    template<class T> static constexpr int value_impl(folly::tag_t<T>) { return 0; }
    static constexpr int value_impl(folly::tag_t<::apache::thrift::field_id<1>>) { return 1; }
    static constexpr int value_impl(folly::tag_t<::apache::thrift::tag::begin>) { return 1; }
    static constexpr int value_impl(folly::tag_t<::apache::thrift::field_id<2>>) { return 2; }
    static constexpr int value_impl(folly::tag_t<::apache::thrift::tag::end>) { return 2; }
    template<class T> static constexpr int value = value_impl(folly::tag_t<T>{});
#endif
  };

  struct __fbthrift_ordinal_impl_for_non_unique_type {
    template<class, class, class> struct Impl { static constexpr int value = 0; };
    template<class T> struct Impl<::apache::thrift::type::struct_t<::apache::thrift::type::SourceLocation>, T, std::enable_if_t<sizeof(T) != -1>> { static constexpr int value = 1; };
    template<class T> struct Impl<::apache::thrift::type::struct_t<::apache::thrift::type::SourceLocation>, T, std::enable_if_t<sizeof(T) != -2>> { static constexpr int value = 2; };

    template<class T> static constexpr int value = Impl<T, T, void>::value;
  };

  template<class T> using __fbthrift_ordinal = ::apache::thrift::field_ordinal<
    std::conditional_t<
        __fbthrift_ordinal_impl::value<T> != 0,
        __fbthrift_ordinal_impl,
        __fbthrift_ordinal_impl_for_non_unique_type>::template value<T>
  >;

  void __fbthrift_clear();
  void __fbthrift_clear_terse_fields();
  bool __fbthrift_is_empty() const;

 public:
  using __fbthrift_cpp2_type = SourceRange;
  static constexpr bool __fbthrift_cpp2_is_union =
    false;


 public:

  SourceRange() {
  }
  // FragileConstructor for use in initialization lists only.
  [[deprecated("This constructor is deprecated")]]
  SourceRange(apache::thrift::FragileConstructor, ::apache::thrift::type::SourceLocation begin__arg, ::apache::thrift::type::SourceLocation end__arg);

  SourceRange(SourceRange&&) noexcept;

  SourceRange(const SourceRange& src);


  SourceRange& operator=(SourceRange&&) noexcept;
  SourceRange& operator=(const SourceRange& src);
 private:
  ::apache::thrift::type::SourceLocation __fbthrift_field_begin;
 private:
  ::apache::thrift::type::SourceLocation __fbthrift_field_end;
 private:
  apache::thrift::detail::isset_bitset<2, apache::thrift::detail::IssetBitsetOption::Unpacked> __isset;

 public:

  bool operator==(const SourceRange&) const;
  bool operator<(const SourceRange&) const;

  template <typename..., typename T = ::apache::thrift::type::SourceLocation>
  FOLLY_ERASE ::apache::thrift::field_ref<const T&> begin_ref() const& {
    return {this->__fbthrift_field_begin, __isset.at(0), __isset.bit(0)};
  }

  template <typename..., typename T = ::apache::thrift::type::SourceLocation>
  FOLLY_ERASE ::apache::thrift::field_ref<const T&&> begin_ref() const&& {
    return {static_cast<const T&&>(this->__fbthrift_field_begin), __isset.at(0), __isset.bit(0)};
  }

  template <typename..., typename T = ::apache::thrift::type::SourceLocation>
  FOLLY_ERASE ::apache::thrift::field_ref<T&> begin_ref() & {
    return {this->__fbthrift_field_begin, __isset.at(0), __isset.bit(0)};
  }

  template <typename..., typename T = ::apache::thrift::type::SourceLocation>
  FOLLY_ERASE ::apache::thrift::field_ref<T&&> begin_ref() && {
    return {static_cast<T&&>(this->__fbthrift_field_begin), __isset.at(0), __isset.bit(0)};
  }

  template <typename..., typename T = ::apache::thrift::type::SourceLocation>
  FOLLY_ERASE ::apache::thrift::field_ref<const T&> begin() const& {
    return {this->__fbthrift_field_begin, __isset.at(0), __isset.bit(0)};
  }

  template <typename..., typename T = ::apache::thrift::type::SourceLocation>
  FOLLY_ERASE ::apache::thrift::field_ref<const T&&> begin() const&& {
    return {static_cast<const T&&>(this->__fbthrift_field_begin), __isset.at(0), __isset.bit(0)};
  }

  template <typename..., typename T = ::apache::thrift::type::SourceLocation>
  FOLLY_ERASE ::apache::thrift::field_ref<T&> begin() & {
    return {this->__fbthrift_field_begin, __isset.at(0), __isset.bit(0)};
  }

  template <typename..., typename T = ::apache::thrift::type::SourceLocation>
  FOLLY_ERASE ::apache::thrift::field_ref<T&&> begin() && {
    return {static_cast<T&&>(this->__fbthrift_field_begin), __isset.at(0), __isset.bit(0)};
  }

  template <typename..., typename T = ::apache::thrift::type::SourceLocation>
  FOLLY_ERASE ::apache::thrift::field_ref<const T&> end_ref() const& {
    return {this->__fbthrift_field_end, __isset.at(1), __isset.bit(1)};
  }

  template <typename..., typename T = ::apache::thrift::type::SourceLocation>
  FOLLY_ERASE ::apache::thrift::field_ref<const T&&> end_ref() const&& {
    return {static_cast<const T&&>(this->__fbthrift_field_end), __isset.at(1), __isset.bit(1)};
  }

  template <typename..., typename T = ::apache::thrift::type::SourceLocation>
  FOLLY_ERASE ::apache::thrift::field_ref<T&> end_ref() & {
    return {this->__fbthrift_field_end, __isset.at(1), __isset.bit(1)};
  }

  template <typename..., typename T = ::apache::thrift::type::SourceLocation>
  FOLLY_ERASE ::apache::thrift::field_ref<T&&> end_ref() && {
    return {static_cast<T&&>(this->__fbthrift_field_end), __isset.at(1), __isset.bit(1)};
  }

  template <typename..., typename T = ::apache::thrift::type::SourceLocation>
  FOLLY_ERASE ::apache::thrift::field_ref<const T&> end() const& {
    return {this->__fbthrift_field_end, __isset.at(1), __isset.bit(1)};
  }

  template <typename..., typename T = ::apache::thrift::type::SourceLocation>
  FOLLY_ERASE ::apache::thrift::field_ref<const T&&> end() const&& {
    return {static_cast<const T&&>(this->__fbthrift_field_end), __isset.at(1), __isset.bit(1)};
  }

  template <typename..., typename T = ::apache::thrift::type::SourceLocation>
  FOLLY_ERASE ::apache::thrift::field_ref<T&> end() & {
    return {this->__fbthrift_field_end, __isset.at(1), __isset.bit(1)};
  }

  template <typename..., typename T = ::apache::thrift::type::SourceLocation>
  FOLLY_ERASE ::apache::thrift::field_ref<T&&> end() && {
    return {static_cast<T&&>(this->__fbthrift_field_end), __isset.at(1), __isset.bit(1)};
  }
  const ::apache::thrift::type::SourceLocation& get_begin() const&;
  ::apache::thrift::type::SourceLocation get_begin() &&;

  template <typename T_SourceRange_begin_struct_setter = ::apache::thrift::type::SourceLocation>
  [[deprecated("Use `FOO.begin_ref() = BAR;` instead of `FOO.set_begin(BAR);`")]]
  ::apache::thrift::type::SourceLocation& set_begin(T_SourceRange_begin_struct_setter&& begin_) {
    begin_ref() = std::forward<T_SourceRange_begin_struct_setter>(begin_);
    return __fbthrift_field_begin;
  }
  const ::apache::thrift::type::SourceLocation& get_end() const&;
  ::apache::thrift::type::SourceLocation get_end() &&;

  template <typename T_SourceRange_end_struct_setter = ::apache::thrift::type::SourceLocation>
  [[deprecated("Use `FOO.end_ref() = BAR;` instead of `FOO.set_end(BAR);`")]]
  ::apache::thrift::type::SourceLocation& set_end(T_SourceRange_end_struct_setter&& end_) {
    end_ref() = std::forward<T_SourceRange_end_struct_setter>(end_);
    return __fbthrift_field_end;
  }

  template <class Protocol_>
  unsigned long read(Protocol_* iprot);
  template <class Protocol_>
  uint32_t serializedSize(Protocol_ const* prot_) const;
  template <class Protocol_>
  uint32_t serializedSizeZC(Protocol_ const* prot_) const;
  template <class Protocol_>
  uint32_t write(Protocol_* prot_) const;

 private:
  template <class Protocol_>
  void readNoXfer(Protocol_* iprot);

  friend class ::apache::thrift::Cpp2Ops<SourceRange>;
  friend void swap(SourceRange& a, SourceRange& b);
};

template <class Protocol_>
unsigned long SourceRange::read(Protocol_* iprot) {
  auto _xferStart = iprot->getCursorPosition();
  readNoXfer(iprot);
  return iprot->getCursorPosition() - _xferStart;
}


}}} // apache::thrift::type

namespace apache { namespace thrift {

template <> struct TEnumDataStorage<::apache::thrift::type::ProtocolUnion::Type>;

template <> struct TEnumTraits<::apache::thrift::type::ProtocolUnion::Type> {
  using type = ::apache::thrift::type::ProtocolUnion::Type;

  static constexpr std::size_t const size = 3;
  static folly::Range<type const*> const values;
  static folly::Range<folly::StringPiece const*> const names;

  static bool findName(type value, folly::StringPiece* out) noexcept;
  static bool findValue(folly::StringPiece name, type* out) noexcept;

#if FOLLY_HAS_STRING_VIEW
  static bool findName(type value, std::string_view* out) noexcept {
    folly::StringPiece outp;
    return findName(value, &outp) && ((*out = outp), true);
  }
#endif
  static char const* findName(type value) noexcept {
    folly::StringPiece ret;
    (void)findName(value, &ret);
    return ret.data();
  }
};
}} // apache::thrift
