/**
 * Autogenerated by Thrift for thrift/compiler/test/fixtures/refs/src/module.thrift
 *
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
 *  @generated @nocommit
 */
#include "thrift/compiler/test/fixtures/refs/gen-cpp2/module_types.h"
#include "thrift/compiler/test/fixtures/refs/gen-cpp2/module_types.tcc"

#include <thrift/lib/cpp2/gen/module_types_cpp.h>

#include "thrift/compiler/test/fixtures/refs/gen-cpp2/module_data.h"

namespace apache { namespace thrift {

constexpr std::size_t const TEnumTraits<::cpp2::MyEnum>::size;
folly::Range<::cpp2::MyEnum const*> const TEnumTraits<::cpp2::MyEnum>::values = folly::range(TEnumDataStorage<::cpp2::MyEnum>::values);
folly::Range<folly::StringPiece const*> const TEnumTraits<::cpp2::MyEnum>::names = folly::range(TEnumDataStorage<::cpp2::MyEnum>::names);

bool TEnumTraits<::cpp2::MyEnum>::findName(type value, folly::StringPiece* out) noexcept {
  return ::apache::thrift::detail::st::enum_find_name(value, out);
}

bool TEnumTraits<::cpp2::MyEnum>::findValue(folly::StringPiece name, type* out) noexcept {
  return ::apache::thrift::detail::st::enum_find_value(name, out);
}

}} // apache::thrift

namespace cpp2 {
#ifndef ANDROID
FOLLY_PUSH_WARNING
FOLLY_GNU_DISABLE_WARNING("-Wdeprecated-declarations")
const _MyEnum_EnumMapFactory::ValuesToNamesMapType _MyEnum_VALUES_TO_NAMES = _MyEnum_EnumMapFactory::makeValuesToNamesMap();
const _MyEnum_EnumMapFactory::NamesToValuesMapType _MyEnum_NAMES_TO_VALUES = _MyEnum_EnumMapFactory::makeNamesToValuesMap();
FOLLY_POP_WARNING
#endif
} // cpp2

namespace apache { namespace thrift {

constexpr std::size_t const TEnumTraits<::cpp2::TypedEnum>::size;
folly::Range<::cpp2::TypedEnum const*> const TEnumTraits<::cpp2::TypedEnum>::values = folly::range(TEnumDataStorage<::cpp2::TypedEnum>::values);
folly::Range<folly::StringPiece const*> const TEnumTraits<::cpp2::TypedEnum>::names = folly::range(TEnumDataStorage<::cpp2::TypedEnum>::names);

bool TEnumTraits<::cpp2::TypedEnum>::findName(type value, folly::StringPiece* out) noexcept {
  return ::apache::thrift::detail::st::enum_find_name(value, out);
}

bool TEnumTraits<::cpp2::TypedEnum>::findValue(folly::StringPiece name, type* out) noexcept {
  return ::apache::thrift::detail::st::enum_find_value(name, out);
}

}} // apache::thrift

namespace cpp2 {
#ifndef ANDROID
FOLLY_PUSH_WARNING
FOLLY_GNU_DISABLE_WARNING("-Wdeprecated-declarations")
const _TypedEnum_EnumMapFactory::ValuesToNamesMapType _TypedEnum_VALUES_TO_NAMES = _TypedEnum_EnumMapFactory::makeValuesToNamesMap();
const _TypedEnum_EnumMapFactory::NamesToValuesMapType _TypedEnum_NAMES_TO_VALUES = _TypedEnum_EnumMapFactory::makeNamesToValuesMap();
FOLLY_POP_WARNING
#endif
} // cpp2

namespace apache {
namespace thrift {
namespace detail {

void TccStructTraits<::cpp2::MyUnion>::translateFieldName(
    folly::StringPiece _fname,
    int16_t& fid,
    apache::thrift::protocol::TType& _ftype) noexcept {
  using data = apache::thrift::TStructDataStorage<::cpp2::MyUnion>;
  static const st::translate_field_name_table table{
      data::fields_size,
      data::fields_names.data(),
      data::fields_ids.data(),
      data::fields_types.data()};
  st::translate_field_name(_fname, fid, _ftype, table);
}

} // namespace detail
} // namespace thrift
} // namespace apache

namespace apache { namespace thrift {

constexpr std::size_t const TEnumTraits<::cpp2::MyUnion::Type>::size;
folly::Range<::cpp2::MyUnion::Type const*> const TEnumTraits<::cpp2::MyUnion::Type>::values = folly::range(TEnumDataStorage<::cpp2::MyUnion::Type>::values);
folly::Range<folly::StringPiece const*> const TEnumTraits<::cpp2::MyUnion::Type>::names = folly::range(TEnumDataStorage<::cpp2::MyUnion::Type>::names);

bool TEnumTraits<::cpp2::MyUnion::Type>::findName(type value, folly::StringPiece* out) noexcept {
  return ::apache::thrift::detail::st::enum_find_name(value, out);
}

bool TEnumTraits<::cpp2::MyUnion::Type>::findValue(folly::StringPiece name, type* out) noexcept {
  return ::apache::thrift::detail::st::enum_find_value(name, out);
}
}} // apache::thrift
namespace cpp2 {

const folly::StringPiece MyUnion::__fbthrift_get_field_name(::apache::thrift::FieldOrdinal ord) {
  if (ord == ::apache::thrift::FieldOrdinal{0}) { return {}; }
  return apache::thrift::TStructDataStorage<MyUnion>::fields_names[folly::to_underlying(ord) - 1];
}

void MyUnion::__fbthrift_clear() {
  // clear all fields
  if (getType() == Type::__EMPTY__) { return; }
  switch(getType()) {
    case Type::anInteger:
      destruct(value_.anInteger);
      break;
    case Type::aString:
      destruct(value_.aString);
      break;
    default:
      assert(false);
      break;
  }
  type_ = folly::to_underlying(Type::__EMPTY__);
}

bool MyUnion::__fbthrift_is_empty() const {
  return getType() == Type::__EMPTY__;
}

bool MyUnion::operator==(const MyUnion& rhs) const {
  if (getType() != rhs.getType()) { return false; }
  switch(getType()) {
    case Type::anInteger:
      return *value_.anInteger == *rhs.value_.anInteger;
    case Type::aString:
      return *value_.aString == *rhs.value_.aString;
    default:
      return true;
  }
}

bool MyUnion::operator<(FOLLY_MAYBE_UNUSED const MyUnion& rhs) const {
  FOLLY_MAYBE_UNUSED auto& lhs = *this;
  if (lhs.getType() != rhs.getType()) {
    return lhs.getType() < rhs.getType();
  }
  switch (lhs.getType()) {
    case Type::anInteger:
      return *lhs.value_.anInteger < *rhs.value_.anInteger;
    case Type::aString:
      return *lhs.value_.aString < *rhs.value_.aString;
    default:
      return false;
  }
}

void swap(MyUnion& a, MyUnion& b) {
  MyUnion temp(std::move(a));
  a = std::move(b);
  b = std::move(temp);
}

template void MyUnion::readNoXfer<>(apache::thrift::BinaryProtocolReader*);
template uint32_t MyUnion::write<>(apache::thrift::BinaryProtocolWriter*) const;
template uint32_t MyUnion::serializedSize<>(apache::thrift::BinaryProtocolWriter const*) const;
template uint32_t MyUnion::serializedSizeZC<>(apache::thrift::BinaryProtocolWriter const*) const;
template void MyUnion::readNoXfer<>(apache::thrift::CompactProtocolReader*);
template uint32_t MyUnion::write<>(apache::thrift::CompactProtocolWriter*) const;
template uint32_t MyUnion::serializedSize<>(apache::thrift::CompactProtocolWriter const*) const;
template uint32_t MyUnion::serializedSizeZC<>(apache::thrift::CompactProtocolWriter const*) const;

} // cpp2

namespace apache {
namespace thrift {
namespace detail {

void TccStructTraits<::cpp2::MyField>::translateFieldName(
    folly::StringPiece _fname,
    int16_t& fid,
    apache::thrift::protocol::TType& _ftype) noexcept {
  using data = apache::thrift::TStructDataStorage<::cpp2::MyField>;
  static const st::translate_field_name_table table{
      data::fields_size,
      data::fields_names.data(),
      data::fields_ids.data(),
      data::fields_types.data()};
  st::translate_field_name(_fname, fid, _ftype, table);
}

} // namespace detail
} // namespace thrift
} // namespace apache

namespace cpp2 {

const folly::StringPiece MyField::__fbthrift_get_field_name(::apache::thrift::FieldOrdinal ord) {
  if (ord == ::apache::thrift::FieldOrdinal{0}) { return {}; }
  return apache::thrift::TStructDataStorage<MyField>::fields_names[folly::to_underlying(ord) - 1];
}

MyField::MyField(const MyField& srcObj) :
    __fbthrift_field_opt_value(::apache::thrift::detail::st::copy_field<
          ::apache::thrift::type_class::integral>(srcObj.__fbthrift_field_opt_value)),
    __fbthrift_field_value(::apache::thrift::detail::st::copy_field<
          ::apache::thrift::type_class::integral>(srcObj.__fbthrift_field_value)),
    __fbthrift_field_req_value(::apache::thrift::detail::st::copy_field<
          ::apache::thrift::type_class::integral>(srcObj.__fbthrift_field_req_value)),
    __fbthrift_field_opt_enum_value(::apache::thrift::detail::st::copy_field<
          ::apache::thrift::type_class::enumeration>(srcObj.__fbthrift_field_opt_enum_value)),
    __fbthrift_field_enum_value(::apache::thrift::detail::st::copy_field<
          ::apache::thrift::type_class::enumeration>(srcObj.__fbthrift_field_enum_value)),
    __fbthrift_field_req_enum_value(::apache::thrift::detail::st::copy_field<
          ::apache::thrift::type_class::enumeration>(srcObj.__fbthrift_field_req_enum_value)),
    __fbthrift_field_opt_str_value(::apache::thrift::detail::st::copy_field<
          ::apache::thrift::type_class::string>(srcObj.__fbthrift_field_opt_str_value)),
    __fbthrift_field_str_value(::apache::thrift::detail::st::copy_field<
          ::apache::thrift::type_class::string>(srcObj.__fbthrift_field_str_value)),
    __fbthrift_field_req_str_value(::apache::thrift::detail::st::copy_field<
          ::apache::thrift::type_class::string>(srcObj.__fbthrift_field_req_str_value)) {
}

MyField& MyField::operator=(const MyField& other) {
  MyField tmp(other);
  swap(*this, tmp);
  return *this;
}

MyField::MyField() :
      __fbthrift_field_value(std::make_unique<::std::int64_t>()),
      __fbthrift_field_req_value(std::make_unique<::std::int64_t>()),
      __fbthrift_field_enum_value(std::make_unique<::cpp2::MyEnum>()),
      __fbthrift_field_req_enum_value(std::make_unique<::cpp2::MyEnum>()),
      __fbthrift_field_str_value(std::make_unique<::std::string>()),
      __fbthrift_field_req_str_value(std::make_unique<::std::string>()) {
}

MyField::~MyField() {}

MyField::MyField(FOLLY_MAYBE_UNUSED MyField&& other) noexcept :
    __fbthrift_field_opt_value(std::move(other.__fbthrift_field_opt_value)),
    __fbthrift_field_value(std::move(other.__fbthrift_field_value)),
    __fbthrift_field_req_value(std::move(other.__fbthrift_field_req_value)),
    __fbthrift_field_opt_enum_value(std::move(other.__fbthrift_field_opt_enum_value)),
    __fbthrift_field_enum_value(std::move(other.__fbthrift_field_enum_value)),
    __fbthrift_field_req_enum_value(std::move(other.__fbthrift_field_req_enum_value)),
    __fbthrift_field_opt_str_value(std::move(other.__fbthrift_field_opt_str_value)),
    __fbthrift_field_str_value(std::move(other.__fbthrift_field_str_value)),
    __fbthrift_field_req_str_value(std::move(other.__fbthrift_field_req_str_value)) {
}

MyField& MyField::operator=(FOLLY_MAYBE_UNUSED MyField&& other) noexcept {
    this->__fbthrift_field_opt_value = std::move(other.__fbthrift_field_opt_value);
    this->__fbthrift_field_value = std::move(other.__fbthrift_field_value);
    this->__fbthrift_field_req_value = std::move(other.__fbthrift_field_req_value);
    this->__fbthrift_field_opt_enum_value = std::move(other.__fbthrift_field_opt_enum_value);
    this->__fbthrift_field_enum_value = std::move(other.__fbthrift_field_enum_value);
    this->__fbthrift_field_req_enum_value = std::move(other.__fbthrift_field_req_enum_value);
    this->__fbthrift_field_opt_str_value = std::move(other.__fbthrift_field_opt_str_value);
    this->__fbthrift_field_str_value = std::move(other.__fbthrift_field_str_value);
    this->__fbthrift_field_req_str_value = std::move(other.__fbthrift_field_req_str_value);
    return *this;
}

MyField::MyField(apache::thrift::FragileConstructor, ::std::unique_ptr<::std::int64_t> opt_value__arg, ::std::unique_ptr<::std::int64_t> value__arg, ::std::unique_ptr<::std::int64_t> req_value__arg, ::std::unique_ptr<::cpp2::MyEnum> opt_enum_value__arg, ::std::unique_ptr<::cpp2::MyEnum> enum_value__arg, ::std::unique_ptr<::cpp2::MyEnum> req_enum_value__arg, ::std::unique_ptr<::std::string> opt_str_value__arg, ::std::unique_ptr<::std::string> str_value__arg, ::std::unique_ptr<::std::string> req_str_value__arg) :
    __fbthrift_field_opt_value(std::move(opt_value__arg)),
    __fbthrift_field_value(std::move(value__arg)),
    __fbthrift_field_req_value(std::move(req_value__arg)),
    __fbthrift_field_opt_enum_value(std::move(opt_enum_value__arg)),
    __fbthrift_field_enum_value(std::move(enum_value__arg)),
    __fbthrift_field_req_enum_value(std::move(req_enum_value__arg)),
    __fbthrift_field_opt_str_value(std::move(opt_str_value__arg)),
    __fbthrift_field_str_value(std::move(str_value__arg)),
    __fbthrift_field_req_str_value(std::move(req_str_value__arg)) {
}

void MyField::__fbthrift_clear() {
  // clear all fields
  this->__fbthrift_field_opt_value.reset();
  this->__fbthrift_field_value = ::apache::thrift::detail::make_mutable_smart_ptr<::std::unique_ptr<::std::int64_t>>();
  this->__fbthrift_field_req_value = ::apache::thrift::detail::make_mutable_smart_ptr<::std::unique_ptr<::std::int64_t>>();
  this->__fbthrift_field_opt_enum_value.reset();
  this->__fbthrift_field_enum_value = ::apache::thrift::detail::make_mutable_smart_ptr<::std::unique_ptr<::cpp2::MyEnum>>();
  this->__fbthrift_field_req_enum_value = ::apache::thrift::detail::make_mutable_smart_ptr<::std::unique_ptr<::cpp2::MyEnum>>();
  this->__fbthrift_field_opt_str_value.reset();
  this->__fbthrift_field_str_value = ::apache::thrift::detail::make_mutable_smart_ptr<::std::unique_ptr<::std::string>>();
  this->__fbthrift_field_req_str_value = ::apache::thrift::detail::make_mutable_smart_ptr<::std::unique_ptr<::std::string>>();
}

void MyField::__fbthrift_clear_terse_fields() {
}

bool MyField::__fbthrift_is_empty() const {
  return false;
}

bool MyField::operator==(FOLLY_MAYBE_UNUSED const MyField& rhs) const {
  FOLLY_MAYBE_UNUSED auto& lhs = *this;
  if ((!::apache::thrift::detail::pointer_equal(lhs.opt_value_ref(), rhs.opt_value_ref()))) {
    return false;
  }
  if ((!::apache::thrift::detail::pointer_equal(lhs.value_ref(), rhs.value_ref()))) {
    return false;
  }
  if ((!::apache::thrift::detail::pointer_equal(lhs.req_value_ref(), rhs.req_value_ref()))) {
    return false;
  }
  if ((!::apache::thrift::detail::pointer_equal(lhs.opt_enum_value_ref(), rhs.opt_enum_value_ref()))) {
    return false;
  }
  if ((!::apache::thrift::detail::pointer_equal(lhs.enum_value_ref(), rhs.enum_value_ref()))) {
    return false;
  }
  if ((!::apache::thrift::detail::pointer_equal(lhs.req_enum_value_ref(), rhs.req_enum_value_ref()))) {
    return false;
  }
  if ((!::apache::thrift::detail::pointer_equal(lhs.opt_str_value_ref(), rhs.opt_str_value_ref()))) {
    return false;
  }
  if ((!::apache::thrift::detail::pointer_equal(lhs.str_value_ref(), rhs.str_value_ref()))) {
    return false;
  }
  if ((!::apache::thrift::detail::pointer_equal(lhs.req_str_value_ref(), rhs.req_str_value_ref()))) {
    return false;
  }
  return true;
}

bool MyField::operator<(FOLLY_MAYBE_UNUSED const MyField& rhs) const {
  FOLLY_MAYBE_UNUSED auto& lhs = *this;
  if ((!::apache::thrift::detail::pointer_equal(lhs.opt_value_ref(), rhs.opt_value_ref()))) {
    return ::apache::thrift::detail::pointer_less(lhs.opt_value_ref(), rhs.opt_value_ref());
  }
  if ((!::apache::thrift::detail::pointer_equal(lhs.value_ref(), rhs.value_ref()))) {
    return ::apache::thrift::detail::pointer_less(lhs.value_ref(), rhs.value_ref());
  }
  if ((!::apache::thrift::detail::pointer_equal(lhs.req_value_ref(), rhs.req_value_ref()))) {
    return ::apache::thrift::detail::pointer_less(lhs.req_value_ref(), rhs.req_value_ref());
  }
  if ((!::apache::thrift::detail::pointer_equal(lhs.opt_enum_value_ref(), rhs.opt_enum_value_ref()))) {
    return ::apache::thrift::detail::pointer_less(lhs.opt_enum_value_ref(), rhs.opt_enum_value_ref());
  }
  if ((!::apache::thrift::detail::pointer_equal(lhs.enum_value_ref(), rhs.enum_value_ref()))) {
    return ::apache::thrift::detail::pointer_less(lhs.enum_value_ref(), rhs.enum_value_ref());
  }
  if ((!::apache::thrift::detail::pointer_equal(lhs.req_enum_value_ref(), rhs.req_enum_value_ref()))) {
    return ::apache::thrift::detail::pointer_less(lhs.req_enum_value_ref(), rhs.req_enum_value_ref());
  }
  if ((!::apache::thrift::detail::pointer_equal(lhs.opt_str_value_ref(), rhs.opt_str_value_ref()))) {
    return ::apache::thrift::detail::pointer_less(lhs.opt_str_value_ref(), rhs.opt_str_value_ref());
  }
  if ((!::apache::thrift::detail::pointer_equal(lhs.str_value_ref(), rhs.str_value_ref()))) {
    return ::apache::thrift::detail::pointer_less(lhs.str_value_ref(), rhs.str_value_ref());
  }
  if ((!::apache::thrift::detail::pointer_equal(lhs.req_str_value_ref(), rhs.req_str_value_ref()))) {
    return ::apache::thrift::detail::pointer_less(lhs.req_str_value_ref(), rhs.req_str_value_ref());
  }
  return false;
}

void swap(FOLLY_MAYBE_UNUSED MyField& a, FOLLY_MAYBE_UNUSED MyField& b) {
  using ::std::swap;
  swap(a.__fbthrift_field_opt_value, b.__fbthrift_field_opt_value);
  swap(a.__fbthrift_field_value, b.__fbthrift_field_value);
  swap(a.__fbthrift_field_req_value, b.__fbthrift_field_req_value);
  swap(a.__fbthrift_field_opt_enum_value, b.__fbthrift_field_opt_enum_value);
  swap(a.__fbthrift_field_enum_value, b.__fbthrift_field_enum_value);
  swap(a.__fbthrift_field_req_enum_value, b.__fbthrift_field_req_enum_value);
  swap(a.__fbthrift_field_opt_str_value, b.__fbthrift_field_opt_str_value);
  swap(a.__fbthrift_field_str_value, b.__fbthrift_field_str_value);
  swap(a.__fbthrift_field_req_str_value, b.__fbthrift_field_req_str_value);
}

template void MyField::readNoXfer<>(apache::thrift::BinaryProtocolReader*);
template uint32_t MyField::write<>(apache::thrift::BinaryProtocolWriter*) const;
template uint32_t MyField::serializedSize<>(apache::thrift::BinaryProtocolWriter const*) const;
template uint32_t MyField::serializedSizeZC<>(apache::thrift::BinaryProtocolWriter const*) const;
template void MyField::readNoXfer<>(apache::thrift::CompactProtocolReader*);
template uint32_t MyField::write<>(apache::thrift::CompactProtocolWriter*) const;
template uint32_t MyField::serializedSize<>(apache::thrift::CompactProtocolWriter const*) const;
template uint32_t MyField::serializedSizeZC<>(apache::thrift::CompactProtocolWriter const*) const;

} // cpp2

namespace apache {
namespace thrift {
namespace detail {

void TccStructTraits<::cpp2::MyStruct>::translateFieldName(
    folly::StringPiece _fname,
    int16_t& fid,
    apache::thrift::protocol::TType& _ftype) noexcept {
  using data = apache::thrift::TStructDataStorage<::cpp2::MyStruct>;
  static const st::translate_field_name_table table{
      data::fields_size,
      data::fields_names.data(),
      data::fields_ids.data(),
      data::fields_types.data()};
  st::translate_field_name(_fname, fid, _ftype, table);
}

} // namespace detail
} // namespace thrift
} // namespace apache

namespace cpp2 {

const folly::StringPiece MyStruct::__fbthrift_get_field_name(::apache::thrift::FieldOrdinal ord) {
  if (ord == ::apache::thrift::FieldOrdinal{0}) { return {}; }
  return apache::thrift::TStructDataStorage<MyStruct>::fields_names[folly::to_underlying(ord) - 1];
}

MyStruct::MyStruct(const MyStruct& srcObj) :
    __fbthrift_field_opt_ref(::apache::thrift::detail::st::copy_field<
          ::apache::thrift::type_class::structure>(srcObj.__fbthrift_field_opt_ref)),
    __fbthrift_field_ref(::apache::thrift::detail::st::copy_field<
          ::apache::thrift::type_class::structure>(srcObj.__fbthrift_field_ref)),
    __fbthrift_field_req_ref(::apache::thrift::detail::st::copy_field<
          ::apache::thrift::type_class::structure>(srcObj.__fbthrift_field_req_ref)) {
}

MyStruct& MyStruct::operator=(const MyStruct& other) {
  MyStruct tmp(other);
  swap(*this, tmp);
  return *this;
}

MyStruct::MyStruct(FOLLY_MAYBE_UNUSED MyStruct&& other) noexcept :
    __fbthrift_field_opt_ref(std::move(other.__fbthrift_field_opt_ref)),
    __fbthrift_field_ref(std::move(other.__fbthrift_field_ref)),
    __fbthrift_field_req_ref(std::move(other.__fbthrift_field_req_ref)) {
}

MyStruct& MyStruct::operator=(FOLLY_MAYBE_UNUSED MyStruct&& other) noexcept {
    this->__fbthrift_field_opt_ref = std::move(other.__fbthrift_field_opt_ref);
    this->__fbthrift_field_ref = std::move(other.__fbthrift_field_ref);
    this->__fbthrift_field_req_ref = std::move(other.__fbthrift_field_req_ref);
    return *this;
}

MyStruct::MyStruct(apache::thrift::FragileConstructor, ::std::unique_ptr<::cpp2::MyField> opt_ref__arg, ::std::unique_ptr<::cpp2::MyField> ref__arg, ::std::unique_ptr<::cpp2::MyField> req_ref__arg) :
    __fbthrift_field_opt_ref(std::move(opt_ref__arg)),
    __fbthrift_field_ref(std::move(ref__arg)),
    __fbthrift_field_req_ref(std::move(req_ref__arg)) {
}

void MyStruct::__fbthrift_clear() {
  // clear all fields
  this->__fbthrift_field_opt_ref.reset();
  if (this->__fbthrift_field_ref) ::apache::thrift::clear(*this->__fbthrift_field_ref);
  if (this->__fbthrift_field_req_ref) ::apache::thrift::clear(*this->__fbthrift_field_req_ref);
}

void MyStruct::__fbthrift_clear_terse_fields() {
}

bool MyStruct::__fbthrift_is_empty() const {
  return false;
}

bool MyStruct::operator==(FOLLY_MAYBE_UNUSED const MyStruct& rhs) const {
  FOLLY_MAYBE_UNUSED auto& lhs = *this;
  if ((!::apache::thrift::detail::pointer_equal(lhs.opt_ref_ref(), rhs.opt_ref_ref()))) {
    return false;
  }
  if ((!::apache::thrift::detail::pointer_equal(lhs.ref_ref(), rhs.ref_ref()))) {
    return false;
  }
  if ((!::apache::thrift::detail::pointer_equal(lhs.req_ref_ref(), rhs.req_ref_ref()))) {
    return false;
  }
  return true;
}

bool MyStruct::operator<(FOLLY_MAYBE_UNUSED const MyStruct& rhs) const {
  FOLLY_MAYBE_UNUSED auto& lhs = *this;
  if ((!::apache::thrift::detail::pointer_equal(lhs.opt_ref_ref(), rhs.opt_ref_ref()))) {
    return ::apache::thrift::detail::pointer_less(lhs.opt_ref_ref(), rhs.opt_ref_ref());
  }
  if ((!::apache::thrift::detail::pointer_equal(lhs.ref_ref(), rhs.ref_ref()))) {
    return ::apache::thrift::detail::pointer_less(lhs.ref_ref(), rhs.ref_ref());
  }
  if ((!::apache::thrift::detail::pointer_equal(lhs.req_ref_ref(), rhs.req_ref_ref()))) {
    return ::apache::thrift::detail::pointer_less(lhs.req_ref_ref(), rhs.req_ref_ref());
  }
  return false;
}

void swap(FOLLY_MAYBE_UNUSED MyStruct& a, FOLLY_MAYBE_UNUSED MyStruct& b) {
  using ::std::swap;
  swap(a.__fbthrift_field_opt_ref, b.__fbthrift_field_opt_ref);
  swap(a.__fbthrift_field_ref, b.__fbthrift_field_ref);
  swap(a.__fbthrift_field_req_ref, b.__fbthrift_field_req_ref);
}

template void MyStruct::readNoXfer<>(apache::thrift::BinaryProtocolReader*);
template uint32_t MyStruct::write<>(apache::thrift::BinaryProtocolWriter*) const;
template uint32_t MyStruct::serializedSize<>(apache::thrift::BinaryProtocolWriter const*) const;
template uint32_t MyStruct::serializedSizeZC<>(apache::thrift::BinaryProtocolWriter const*) const;
template void MyStruct::readNoXfer<>(apache::thrift::CompactProtocolReader*);
template uint32_t MyStruct::write<>(apache::thrift::CompactProtocolWriter*) const;
template uint32_t MyStruct::serializedSize<>(apache::thrift::CompactProtocolWriter const*) const;
template uint32_t MyStruct::serializedSizeZC<>(apache::thrift::CompactProtocolWriter const*) const;

static_assert(
    ::apache::thrift::detail::st::gen_check_json<
        MyStruct,
        ::apache::thrift::type_class::structure,
        ::cpp2::MyField>,
    "inconsistent use of json option");
static_assert(
    ::apache::thrift::detail::st::gen_check_json<
        MyStruct,
        ::apache::thrift::type_class::structure,
        ::cpp2::MyField>,
    "inconsistent use of json option");
static_assert(
    ::apache::thrift::detail::st::gen_check_json<
        MyStruct,
        ::apache::thrift::type_class::structure,
        ::cpp2::MyField>,
    "inconsistent use of json option");

} // cpp2

namespace apache {
namespace thrift {
namespace detail {

void TccStructTraits<::cpp2::StructWithUnion>::translateFieldName(
    folly::StringPiece _fname,
    int16_t& fid,
    apache::thrift::protocol::TType& _ftype) noexcept {
  using data = apache::thrift::TStructDataStorage<::cpp2::StructWithUnion>;
  static const st::translate_field_name_table table{
      data::fields_size,
      data::fields_names.data(),
      data::fields_ids.data(),
      data::fields_types.data()};
  st::translate_field_name(_fname, fid, _ftype, table);
}

} // namespace detail
} // namespace thrift
} // namespace apache

namespace cpp2 {

const folly::StringPiece StructWithUnion::__fbthrift_get_field_name(::apache::thrift::FieldOrdinal ord) {
  if (ord == ::apache::thrift::FieldOrdinal{0}) { return {}; }
  return apache::thrift::TStructDataStorage<StructWithUnion>::fields_names[folly::to_underlying(ord) - 1];
}

StructWithUnion::StructWithUnion(const StructWithUnion& srcObj) :
    __fbthrift_field_u(::apache::thrift::detail::st::copy_field<
          ::apache::thrift::type_class::variant>(srcObj.__fbthrift_field_u)),
    __fbthrift_field_aDouble(::apache::thrift::detail::st::copy_field<
          ::apache::thrift::type_class::floating_point>(srcObj.__fbthrift_field_aDouble)),
    __fbthrift_field_f(srcObj.__fbthrift_field_f),
    __isset(srcObj.__isset) {
}

StructWithUnion& StructWithUnion::operator=(const StructWithUnion& other) {
  StructWithUnion tmp(other);
  swap(*this, tmp);
  return *this;
}

StructWithUnion::StructWithUnion(FOLLY_MAYBE_UNUSED StructWithUnion&& other) noexcept :
    __fbthrift_field_u(std::move(other.__fbthrift_field_u)),
    __fbthrift_field_aDouble(std::move(other.__fbthrift_field_aDouble)),
    __fbthrift_field_f(std::move(other.__fbthrift_field_f)),
    __isset(other.__isset) {
}

StructWithUnion& StructWithUnion::operator=(FOLLY_MAYBE_UNUSED StructWithUnion&& other) noexcept {
    this->__fbthrift_field_u = std::move(other.__fbthrift_field_u);
    this->__fbthrift_field_aDouble = std::move(other.__fbthrift_field_aDouble);
    this->__fbthrift_field_f = std::move(other.__fbthrift_field_f);
    __isset = other.__isset;
    return *this;
}

StructWithUnion::StructWithUnion(apache::thrift::FragileConstructor, ::std::unique_ptr<::cpp2::MyUnion> u__arg, ::std::unique_ptr<double> aDouble__arg, ::cpp2::MyField f__arg) :
    __fbthrift_field_u(std::move(u__arg)),
    __fbthrift_field_aDouble(std::move(aDouble__arg)),
    __fbthrift_field_f(std::move(f__arg)) {
  __isset.set(folly::index_constant<0>(), true);
}

void StructWithUnion::__fbthrift_clear() {
  // clear all fields
  if (this->__fbthrift_field_u) ::apache::thrift::clear(*this->__fbthrift_field_u);
  this->__fbthrift_field_aDouble = ::apache::thrift::detail::make_mutable_smart_ptr<::std::unique_ptr<double>>();
  ::apache::thrift::clear(this->__fbthrift_field_f);
  __isset = {};
}

void StructWithUnion::__fbthrift_clear_terse_fields() {
}

bool StructWithUnion::__fbthrift_is_empty() const {
  return false;
}

bool StructWithUnion::operator==(FOLLY_MAYBE_UNUSED const StructWithUnion& rhs) const {
  FOLLY_MAYBE_UNUSED auto& lhs = *this;
  if ((!::apache::thrift::detail::pointer_equal(lhs.u_ref(), rhs.u_ref()))) {
    return false;
  }
  if ((!::apache::thrift::detail::pointer_equal(lhs.aDouble_ref(), rhs.aDouble_ref()))) {
    return false;
  }
  if (!(lhs.f_ref() == rhs.f_ref())) {
    return false;
  }
  return true;
}

bool StructWithUnion::operator<(FOLLY_MAYBE_UNUSED const StructWithUnion& rhs) const {
  FOLLY_MAYBE_UNUSED auto& lhs = *this;
  if ((!::apache::thrift::detail::pointer_equal(lhs.u_ref(), rhs.u_ref()))) {
    return ::apache::thrift::detail::pointer_less(lhs.u_ref(), rhs.u_ref());
  }
  if ((!::apache::thrift::detail::pointer_equal(lhs.aDouble_ref(), rhs.aDouble_ref()))) {
    return ::apache::thrift::detail::pointer_less(lhs.aDouble_ref(), rhs.aDouble_ref());
  }
  if (!(lhs.f_ref() == rhs.f_ref())) {
    return lhs.f_ref() < rhs.f_ref();
  }
  return false;
}

const ::cpp2::MyField& StructWithUnion::get_f() const& {
  return __fbthrift_field_f;
}

::cpp2::MyField StructWithUnion::get_f() && {
  return std::move(__fbthrift_field_f);
}

void swap(FOLLY_MAYBE_UNUSED StructWithUnion& a, FOLLY_MAYBE_UNUSED StructWithUnion& b) {
  using ::std::swap;
  swap(a.__fbthrift_field_u, b.__fbthrift_field_u);
  swap(a.__fbthrift_field_aDouble, b.__fbthrift_field_aDouble);
  swap(a.__fbthrift_field_f, b.__fbthrift_field_f);
  swap(a.__isset, b.__isset);
}

template void StructWithUnion::readNoXfer<>(apache::thrift::BinaryProtocolReader*);
template uint32_t StructWithUnion::write<>(apache::thrift::BinaryProtocolWriter*) const;
template uint32_t StructWithUnion::serializedSize<>(apache::thrift::BinaryProtocolWriter const*) const;
template uint32_t StructWithUnion::serializedSizeZC<>(apache::thrift::BinaryProtocolWriter const*) const;
template void StructWithUnion::readNoXfer<>(apache::thrift::CompactProtocolReader*);
template uint32_t StructWithUnion::write<>(apache::thrift::CompactProtocolWriter*) const;
template uint32_t StructWithUnion::serializedSize<>(apache::thrift::CompactProtocolWriter const*) const;
template uint32_t StructWithUnion::serializedSizeZC<>(apache::thrift::CompactProtocolWriter const*) const;

static_assert(
    ::apache::thrift::detail::st::gen_check_json<
        StructWithUnion,
        ::apache::thrift::type_class::variant,
        ::cpp2::MyUnion>,
    "inconsistent use of json option");
static_assert(
    ::apache::thrift::detail::st::gen_check_json<
        StructWithUnion,
        ::apache::thrift::type_class::structure,
        ::cpp2::MyField>,
    "inconsistent use of json option");

} // cpp2

namespace apache {
namespace thrift {
namespace detail {

void TccStructTraits<::cpp2::RecursiveStruct>::translateFieldName(
    folly::StringPiece _fname,
    int16_t& fid,
    apache::thrift::protocol::TType& _ftype) noexcept {
  using data = apache::thrift::TStructDataStorage<::cpp2::RecursiveStruct>;
  static const st::translate_field_name_table table{
      data::fields_size,
      data::fields_names.data(),
      data::fields_ids.data(),
      data::fields_types.data()};
  st::translate_field_name(_fname, fid, _ftype, table);
}

} // namespace detail
} // namespace thrift
} // namespace apache

namespace cpp2 {

const folly::StringPiece RecursiveStruct::__fbthrift_get_field_name(::apache::thrift::FieldOrdinal ord) {
  if (ord == ::apache::thrift::FieldOrdinal{0}) { return {}; }
  return apache::thrift::TStructDataStorage<RecursiveStruct>::fields_names[folly::to_underlying(ord) - 1];
}

RecursiveStruct::RecursiveStruct(const RecursiveStruct&) = default;
RecursiveStruct& RecursiveStruct::operator=(const RecursiveStruct&) = default;
RecursiveStruct::RecursiveStruct(FOLLY_MAYBE_UNUSED RecursiveStruct&& other) noexcept :
    __fbthrift_field_mes(std::move(other.__fbthrift_field_mes)),
    __isset(other.__isset) {
}

RecursiveStruct& RecursiveStruct::operator=(FOLLY_MAYBE_UNUSED RecursiveStruct&& other) noexcept {
    this->__fbthrift_field_mes = std::move(other.__fbthrift_field_mes);
    __isset = other.__isset;
    return *this;
}

RecursiveStruct::RecursiveStruct(apache::thrift::FragileConstructor, ::std::vector<::cpp2::RecursiveStruct> mes__arg) :
    __fbthrift_field_mes(std::move(mes__arg)) {
  __isset.set(folly::index_constant<0>(), true);
}

void RecursiveStruct::__fbthrift_clear() {
  // clear all fields
  this->__fbthrift_field_mes.clear();
  __isset = {};
}

void RecursiveStruct::__fbthrift_clear_terse_fields() {
}

bool RecursiveStruct::__fbthrift_is_empty() const {
  return !(this->__isset.get(0));
}

bool RecursiveStruct::operator==(FOLLY_MAYBE_UNUSED const RecursiveStruct& rhs) const {
  FOLLY_MAYBE_UNUSED auto& lhs = *this;
  if (!(lhs.mes_ref() == rhs.mes_ref())) {
    return false;
  }
  return true;
}

bool RecursiveStruct::operator<(FOLLY_MAYBE_UNUSED const RecursiveStruct& rhs) const {
  FOLLY_MAYBE_UNUSED auto& lhs = *this;
  if (!(lhs.mes_ref() == rhs.mes_ref())) {
    return lhs.mes_ref() < rhs.mes_ref();
  }
  return false;
}

const ::std::vector<::cpp2::RecursiveStruct>* RecursiveStruct::get_mes() const& {
  return mes_ref().has_value() ? std::addressof(__fbthrift_field_mes) : nullptr;
}

::std::vector<::cpp2::RecursiveStruct>* RecursiveStruct::get_mes() & {
  return mes_ref().has_value() ? std::addressof(__fbthrift_field_mes) : nullptr;
}

void swap(FOLLY_MAYBE_UNUSED RecursiveStruct& a, FOLLY_MAYBE_UNUSED RecursiveStruct& b) {
  using ::std::swap;
  swap(a.__fbthrift_field_mes, b.__fbthrift_field_mes);
  swap(a.__isset, b.__isset);
}

template void RecursiveStruct::readNoXfer<>(apache::thrift::BinaryProtocolReader*);
template uint32_t RecursiveStruct::write<>(apache::thrift::BinaryProtocolWriter*) const;
template uint32_t RecursiveStruct::serializedSize<>(apache::thrift::BinaryProtocolWriter const*) const;
template uint32_t RecursiveStruct::serializedSizeZC<>(apache::thrift::BinaryProtocolWriter const*) const;
template void RecursiveStruct::readNoXfer<>(apache::thrift::CompactProtocolReader*);
template uint32_t RecursiveStruct::write<>(apache::thrift::CompactProtocolWriter*) const;
template uint32_t RecursiveStruct::serializedSize<>(apache::thrift::CompactProtocolWriter const*) const;
template uint32_t RecursiveStruct::serializedSizeZC<>(apache::thrift::CompactProtocolWriter const*) const;

} // cpp2

namespace apache {
namespace thrift {
namespace detail {

void TccStructTraits<::cpp2::StructWithContainers>::translateFieldName(
    folly::StringPiece _fname,
    int16_t& fid,
    apache::thrift::protocol::TType& _ftype) noexcept {
  using data = apache::thrift::TStructDataStorage<::cpp2::StructWithContainers>;
  static const st::translate_field_name_table table{
      data::fields_size,
      data::fields_names.data(),
      data::fields_ids.data(),
      data::fields_types.data()};
  st::translate_field_name(_fname, fid, _ftype, table);
}

} // namespace detail
} // namespace thrift
} // namespace apache

namespace cpp2 {

const folly::StringPiece StructWithContainers::__fbthrift_get_field_name(::apache::thrift::FieldOrdinal ord) {
  if (ord == ::apache::thrift::FieldOrdinal{0}) { return {}; }
  return apache::thrift::TStructDataStorage<StructWithContainers>::fields_names[folly::to_underlying(ord) - 1];
}

StructWithContainers::StructWithContainers(const StructWithContainers& srcObj) :
    __fbthrift_field_list_ref(::apache::thrift::detail::st::copy_field<
          ::apache::thrift::type_class::list<::apache::thrift::type_class::integral>>(srcObj.__fbthrift_field_list_ref)),
    __fbthrift_field_set_ref(::apache::thrift::detail::st::copy_field<
          ::apache::thrift::type_class::set<::apache::thrift::type_class::integral>>(srcObj.__fbthrift_field_set_ref)),
    __fbthrift_field_map_ref(::apache::thrift::detail::st::copy_field<
          ::apache::thrift::type_class::map<::apache::thrift::type_class::integral, ::apache::thrift::type_class::integral>>(srcObj.__fbthrift_field_map_ref)),
    __fbthrift_field_list_ref_unique(::apache::thrift::detail::st::copy_field<
          ::apache::thrift::type_class::list<::apache::thrift::type_class::integral>>(srcObj.__fbthrift_field_list_ref_unique)),
    __fbthrift_field_set_ref_shared(srcObj.__fbthrift_field_set_ref_shared),
    __fbthrift_field_list_ref_shared_const(srcObj.__fbthrift_field_list_ref_shared_const) {
}

StructWithContainers& StructWithContainers::operator=(const StructWithContainers& other) {
  StructWithContainers tmp(other);
  swap(*this, tmp);
  return *this;
}

StructWithContainers::StructWithContainers() :
      __fbthrift_field_list_ref(std::make_unique<::std::vector<::std::int32_t>>()),
      __fbthrift_field_set_ref(std::make_unique<::std::set<::std::int32_t>>()),
      __fbthrift_field_map_ref(std::make_unique<::std::map<::std::int32_t, ::std::int32_t>>()),
      __fbthrift_field_list_ref_unique(std::make_unique<::std::vector<::std::int32_t>>()),
      __fbthrift_field_set_ref_shared(std::make_shared<::std::set<::std::int32_t>>()),
      __fbthrift_field_list_ref_shared_const(std::make_shared<::std::vector<::std::int32_t>>()) {
}

StructWithContainers::~StructWithContainers() {}

StructWithContainers::StructWithContainers(FOLLY_MAYBE_UNUSED StructWithContainers&& other) noexcept :
    __fbthrift_field_list_ref(std::move(other.__fbthrift_field_list_ref)),
    __fbthrift_field_set_ref(std::move(other.__fbthrift_field_set_ref)),
    __fbthrift_field_map_ref(std::move(other.__fbthrift_field_map_ref)),
    __fbthrift_field_list_ref_unique(std::move(other.__fbthrift_field_list_ref_unique)),
    __fbthrift_field_set_ref_shared(std::move(other.__fbthrift_field_set_ref_shared)),
    __fbthrift_field_list_ref_shared_const(std::move(other.__fbthrift_field_list_ref_shared_const)) {
}

StructWithContainers& StructWithContainers::operator=(FOLLY_MAYBE_UNUSED StructWithContainers&& other) noexcept {
    this->__fbthrift_field_list_ref = std::move(other.__fbthrift_field_list_ref);
    this->__fbthrift_field_set_ref = std::move(other.__fbthrift_field_set_ref);
    this->__fbthrift_field_map_ref = std::move(other.__fbthrift_field_map_ref);
    this->__fbthrift_field_list_ref_unique = std::move(other.__fbthrift_field_list_ref_unique);
    this->__fbthrift_field_set_ref_shared = std::move(other.__fbthrift_field_set_ref_shared);
    this->__fbthrift_field_list_ref_shared_const = std::move(other.__fbthrift_field_list_ref_shared_const);
    return *this;
}

StructWithContainers::StructWithContainers(apache::thrift::FragileConstructor, ::std::unique_ptr<::std::vector<::std::int32_t>> list_ref__arg, ::std::unique_ptr<::std::set<::std::int32_t>> set_ref__arg, ::std::unique_ptr<::std::map<::std::int32_t, ::std::int32_t>> map_ref__arg, ::std::unique_ptr<::std::vector<::std::int32_t>> list_ref_unique__arg, ::std::shared_ptr<::std::set<::std::int32_t>> set_ref_shared__arg, ::std::shared_ptr<const ::std::vector<::std::int32_t>> list_ref_shared_const__arg) :
    __fbthrift_field_list_ref(std::move(list_ref__arg)),
    __fbthrift_field_set_ref(std::move(set_ref__arg)),
    __fbthrift_field_map_ref(std::move(map_ref__arg)),
    __fbthrift_field_list_ref_unique(std::move(list_ref_unique__arg)),
    __fbthrift_field_set_ref_shared(std::move(set_ref_shared__arg)),
    __fbthrift_field_list_ref_shared_const(std::move(list_ref_shared_const__arg)) {
}

void StructWithContainers::__fbthrift_clear() {
  // clear all fields
  this->__fbthrift_field_list_ref = ::apache::thrift::detail::make_mutable_smart_ptr<::std::unique_ptr<::std::vector<::std::int32_t>>>();
  this->__fbthrift_field_set_ref = ::apache::thrift::detail::make_mutable_smart_ptr<::std::unique_ptr<::std::set<::std::int32_t>>>();
  this->__fbthrift_field_map_ref = ::apache::thrift::detail::make_mutable_smart_ptr<::std::unique_ptr<::std::map<::std::int32_t, ::std::int32_t>>>();
  this->__fbthrift_field_list_ref_unique = ::apache::thrift::detail::make_mutable_smart_ptr<::std::unique_ptr<::std::vector<::std::int32_t>>>();
  this->__fbthrift_field_set_ref_shared = ::apache::thrift::detail::make_mutable_smart_ptr<::std::shared_ptr<::std::set<::std::int32_t>>>();
  this->__fbthrift_field_list_ref_shared_const = ::apache::thrift::detail::make_mutable_smart_ptr<::std::shared_ptr<const ::std::vector<::std::int32_t>>>();
}

void StructWithContainers::__fbthrift_clear_terse_fields() {
}

bool StructWithContainers::__fbthrift_is_empty() const {
  return false;
}

bool StructWithContainers::operator==(FOLLY_MAYBE_UNUSED const StructWithContainers& rhs) const {
  FOLLY_MAYBE_UNUSED auto& lhs = *this;
  if ((!::apache::thrift::detail::pointer_equal(lhs.list_ref_ref(), rhs.list_ref_ref()))) {
    return false;
  }
  if ((!::apache::thrift::detail::pointer_equal(lhs.set_ref_ref(), rhs.set_ref_ref()))) {
    return false;
  }
  if ((!::apache::thrift::detail::pointer_equal(lhs.map_ref_ref(), rhs.map_ref_ref()))) {
    return false;
  }
  if ((!::apache::thrift::detail::pointer_equal(lhs.list_ref_unique_ref(), rhs.list_ref_unique_ref()))) {
    return false;
  }
  if ((!::apache::thrift::detail::pointer_equal(lhs.set_ref_shared_ref(), rhs.set_ref_shared_ref()))) {
    return false;
  }
  if ((!::apache::thrift::detail::pointer_equal(lhs.list_ref_shared_const_ref(), rhs.list_ref_shared_const_ref()))) {
    return false;
  }
  return true;
}

bool StructWithContainers::operator<(FOLLY_MAYBE_UNUSED const StructWithContainers& rhs) const {
  FOLLY_MAYBE_UNUSED auto& lhs = *this;
  if ((!::apache::thrift::detail::pointer_equal(lhs.list_ref_ref(), rhs.list_ref_ref()))) {
    return ::apache::thrift::detail::pointer_less(lhs.list_ref_ref(), rhs.list_ref_ref());
  }
  if ((!::apache::thrift::detail::pointer_equal(lhs.set_ref_ref(), rhs.set_ref_ref()))) {
    return ::apache::thrift::detail::pointer_less(lhs.set_ref_ref(), rhs.set_ref_ref());
  }
  if ((!::apache::thrift::detail::pointer_equal(lhs.map_ref_ref(), rhs.map_ref_ref()))) {
    return ::apache::thrift::detail::pointer_less(lhs.map_ref_ref(), rhs.map_ref_ref());
  }
  if ((!::apache::thrift::detail::pointer_equal(lhs.list_ref_unique_ref(), rhs.list_ref_unique_ref()))) {
    return ::apache::thrift::detail::pointer_less(lhs.list_ref_unique_ref(), rhs.list_ref_unique_ref());
  }
  if ((!::apache::thrift::detail::pointer_equal(lhs.set_ref_shared_ref(), rhs.set_ref_shared_ref()))) {
    return ::apache::thrift::detail::pointer_less(lhs.set_ref_shared_ref(), rhs.set_ref_shared_ref());
  }
  if ((!::apache::thrift::detail::pointer_equal(lhs.list_ref_shared_const_ref(), rhs.list_ref_shared_const_ref()))) {
    return ::apache::thrift::detail::pointer_less(lhs.list_ref_shared_const_ref(), rhs.list_ref_shared_const_ref());
  }
  return false;
}

void swap(FOLLY_MAYBE_UNUSED StructWithContainers& a, FOLLY_MAYBE_UNUSED StructWithContainers& b) {
  using ::std::swap;
  swap(a.__fbthrift_field_list_ref, b.__fbthrift_field_list_ref);
  swap(a.__fbthrift_field_set_ref, b.__fbthrift_field_set_ref);
  swap(a.__fbthrift_field_map_ref, b.__fbthrift_field_map_ref);
  swap(a.__fbthrift_field_list_ref_unique, b.__fbthrift_field_list_ref_unique);
  swap(a.__fbthrift_field_set_ref_shared, b.__fbthrift_field_set_ref_shared);
  swap(a.__fbthrift_field_list_ref_shared_const, b.__fbthrift_field_list_ref_shared_const);
}

template void StructWithContainers::readNoXfer<>(apache::thrift::BinaryProtocolReader*);
template uint32_t StructWithContainers::write<>(apache::thrift::BinaryProtocolWriter*) const;
template uint32_t StructWithContainers::serializedSize<>(apache::thrift::BinaryProtocolWriter const*) const;
template uint32_t StructWithContainers::serializedSizeZC<>(apache::thrift::BinaryProtocolWriter const*) const;
template void StructWithContainers::readNoXfer<>(apache::thrift::CompactProtocolReader*);
template uint32_t StructWithContainers::write<>(apache::thrift::CompactProtocolWriter*) const;
template uint32_t StructWithContainers::serializedSize<>(apache::thrift::CompactProtocolWriter const*) const;
template uint32_t StructWithContainers::serializedSizeZC<>(apache::thrift::CompactProtocolWriter const*) const;

} // cpp2

namespace apache {
namespace thrift {
namespace detail {

void TccStructTraits<::cpp2::StructWithSharedConst>::translateFieldName(
    folly::StringPiece _fname,
    int16_t& fid,
    apache::thrift::protocol::TType& _ftype) noexcept {
  using data = apache::thrift::TStructDataStorage<::cpp2::StructWithSharedConst>;
  static const st::translate_field_name_table table{
      data::fields_size,
      data::fields_names.data(),
      data::fields_ids.data(),
      data::fields_types.data()};
  st::translate_field_name(_fname, fid, _ftype, table);
}

} // namespace detail
} // namespace thrift
} // namespace apache

namespace cpp2 {

const folly::StringPiece StructWithSharedConst::__fbthrift_get_field_name(::apache::thrift::FieldOrdinal ord) {
  if (ord == ::apache::thrift::FieldOrdinal{0}) { return {}; }
  return apache::thrift::TStructDataStorage<StructWithSharedConst>::fields_names[folly::to_underlying(ord) - 1];
}

StructWithSharedConst::StructWithSharedConst(const StructWithSharedConst&) = default;
StructWithSharedConst& StructWithSharedConst::operator=(const StructWithSharedConst&) = default;
StructWithSharedConst::StructWithSharedConst(FOLLY_MAYBE_UNUSED StructWithSharedConst&& other) noexcept :
    __fbthrift_field_opt_shared_const(std::move(other.__fbthrift_field_opt_shared_const)),
    __fbthrift_field_shared_const(std::move(other.__fbthrift_field_shared_const)),
    __fbthrift_field_req_shared_const(std::move(other.__fbthrift_field_req_shared_const)) {
}

StructWithSharedConst& StructWithSharedConst::operator=(FOLLY_MAYBE_UNUSED StructWithSharedConst&& other) noexcept {
    this->__fbthrift_field_opt_shared_const = std::move(other.__fbthrift_field_opt_shared_const);
    this->__fbthrift_field_shared_const = std::move(other.__fbthrift_field_shared_const);
    this->__fbthrift_field_req_shared_const = std::move(other.__fbthrift_field_req_shared_const);
    return *this;
}

StructWithSharedConst::StructWithSharedConst(apache::thrift::FragileConstructor, ::std::shared_ptr<const ::cpp2::MyField> opt_shared_const__arg, ::std::shared_ptr<const ::cpp2::MyField> shared_const__arg, ::std::shared_ptr<const ::cpp2::MyField> req_shared_const__arg) :
    __fbthrift_field_opt_shared_const(std::move(opt_shared_const__arg)),
    __fbthrift_field_shared_const(std::move(shared_const__arg)),
    __fbthrift_field_req_shared_const(std::move(req_shared_const__arg)) {
}

void StructWithSharedConst::__fbthrift_clear() {
  // clear all fields
  this->__fbthrift_field_opt_shared_const.reset();
  if (this->__fbthrift_field_shared_const) this->__fbthrift_field_shared_const = ::apache::thrift::detail::make_mutable_smart_ptr<::std::shared_ptr<const ::cpp2::MyField>>();
  if (this->__fbthrift_field_req_shared_const) this->__fbthrift_field_req_shared_const = ::apache::thrift::detail::make_mutable_smart_ptr<::std::shared_ptr<const ::cpp2::MyField>>();
}

void StructWithSharedConst::__fbthrift_clear_terse_fields() {
}

bool StructWithSharedConst::__fbthrift_is_empty() const {
  return false;
}

bool StructWithSharedConst::operator==(FOLLY_MAYBE_UNUSED const StructWithSharedConst& rhs) const {
  FOLLY_MAYBE_UNUSED auto& lhs = *this;
  if ((!::apache::thrift::detail::pointer_equal(lhs.opt_shared_const_ref(), rhs.opt_shared_const_ref()))) {
    return false;
  }
  if ((!::apache::thrift::detail::pointer_equal(lhs.shared_const_ref(), rhs.shared_const_ref()))) {
    return false;
  }
  if ((!::apache::thrift::detail::pointer_equal(lhs.req_shared_const_ref(), rhs.req_shared_const_ref()))) {
    return false;
  }
  return true;
}

bool StructWithSharedConst::operator<(FOLLY_MAYBE_UNUSED const StructWithSharedConst& rhs) const {
  FOLLY_MAYBE_UNUSED auto& lhs = *this;
  if ((!::apache::thrift::detail::pointer_equal(lhs.opt_shared_const_ref(), rhs.opt_shared_const_ref()))) {
    return ::apache::thrift::detail::pointer_less(lhs.opt_shared_const_ref(), rhs.opt_shared_const_ref());
  }
  if ((!::apache::thrift::detail::pointer_equal(lhs.shared_const_ref(), rhs.shared_const_ref()))) {
    return ::apache::thrift::detail::pointer_less(lhs.shared_const_ref(), rhs.shared_const_ref());
  }
  if ((!::apache::thrift::detail::pointer_equal(lhs.req_shared_const_ref(), rhs.req_shared_const_ref()))) {
    return ::apache::thrift::detail::pointer_less(lhs.req_shared_const_ref(), rhs.req_shared_const_ref());
  }
  return false;
}

void swap(FOLLY_MAYBE_UNUSED StructWithSharedConst& a, FOLLY_MAYBE_UNUSED StructWithSharedConst& b) {
  using ::std::swap;
  swap(a.__fbthrift_field_opt_shared_const, b.__fbthrift_field_opt_shared_const);
  swap(a.__fbthrift_field_shared_const, b.__fbthrift_field_shared_const);
  swap(a.__fbthrift_field_req_shared_const, b.__fbthrift_field_req_shared_const);
}

template void StructWithSharedConst::readNoXfer<>(apache::thrift::BinaryProtocolReader*);
template uint32_t StructWithSharedConst::write<>(apache::thrift::BinaryProtocolWriter*) const;
template uint32_t StructWithSharedConst::serializedSize<>(apache::thrift::BinaryProtocolWriter const*) const;
template uint32_t StructWithSharedConst::serializedSizeZC<>(apache::thrift::BinaryProtocolWriter const*) const;
template void StructWithSharedConst::readNoXfer<>(apache::thrift::CompactProtocolReader*);
template uint32_t StructWithSharedConst::write<>(apache::thrift::CompactProtocolWriter*) const;
template uint32_t StructWithSharedConst::serializedSize<>(apache::thrift::CompactProtocolWriter const*) const;
template uint32_t StructWithSharedConst::serializedSizeZC<>(apache::thrift::CompactProtocolWriter const*) const;

static_assert(
    ::apache::thrift::detail::st::gen_check_json<
        StructWithSharedConst,
        ::apache::thrift::type_class::structure,
        ::cpp2::MyField>,
    "inconsistent use of json option");
static_assert(
    ::apache::thrift::detail::st::gen_check_json<
        StructWithSharedConst,
        ::apache::thrift::type_class::structure,
        ::cpp2::MyField>,
    "inconsistent use of json option");
static_assert(
    ::apache::thrift::detail::st::gen_check_json<
        StructWithSharedConst,
        ::apache::thrift::type_class::structure,
        ::cpp2::MyField>,
    "inconsistent use of json option");

} // cpp2

namespace apache {
namespace thrift {
namespace detail {

void TccStructTraits<::cpp2::Empty>::translateFieldName(
    folly::StringPiece _fname,
    int16_t& fid,
    apache::thrift::protocol::TType& _ftype) noexcept {
  using data = apache::thrift::TStructDataStorage<::cpp2::Empty>;
  static const st::translate_field_name_table table{
      data::fields_size,
      data::fields_names.data(),
      data::fields_ids.data(),
      data::fields_types.data()};
  st::translate_field_name(_fname, fid, _ftype, table);
}

} // namespace detail
} // namespace thrift
} // namespace apache

namespace cpp2 {

const folly::StringPiece Empty::__fbthrift_get_field_name(::apache::thrift::FieldOrdinal ord) {
  if (ord == ::apache::thrift::FieldOrdinal{0}) { return {}; }
  return apache::thrift::TStructDataStorage<Empty>::fields_names[folly::to_underlying(ord) - 1];
}

Empty::Empty(apache::thrift::FragileConstructor) {}

void Empty::__fbthrift_clear() {
  // clear all fields
}

void Empty::__fbthrift_clear_terse_fields() {
}

bool Empty::__fbthrift_is_empty() const {
  return true;
}

bool Empty::operator==(FOLLY_MAYBE_UNUSED const Empty& rhs) const {
  FOLLY_MAYBE_UNUSED auto& lhs = *this;
  return true;
}

bool Empty::operator<(FOLLY_MAYBE_UNUSED const Empty& rhs) const {
  FOLLY_MAYBE_UNUSED auto& lhs = *this;
  return false;
}

void swap(FOLLY_MAYBE_UNUSED Empty& a, FOLLY_MAYBE_UNUSED Empty& b) {
  using ::std::swap;
}

template void Empty::readNoXfer<>(apache::thrift::BinaryProtocolReader*);
template uint32_t Empty::write<>(apache::thrift::BinaryProtocolWriter*) const;
template uint32_t Empty::serializedSize<>(apache::thrift::BinaryProtocolWriter const*) const;
template uint32_t Empty::serializedSizeZC<>(apache::thrift::BinaryProtocolWriter const*) const;
template void Empty::readNoXfer<>(apache::thrift::CompactProtocolReader*);
template uint32_t Empty::write<>(apache::thrift::CompactProtocolWriter*) const;
template uint32_t Empty::serializedSize<>(apache::thrift::CompactProtocolWriter const*) const;
template uint32_t Empty::serializedSizeZC<>(apache::thrift::CompactProtocolWriter const*) const;

} // cpp2

namespace apache {
namespace thrift {
namespace detail {

void TccStructTraits<::cpp2::StructWithRef>::translateFieldName(
    folly::StringPiece _fname,
    int16_t& fid,
    apache::thrift::protocol::TType& _ftype) noexcept {
  using data = apache::thrift::TStructDataStorage<::cpp2::StructWithRef>;
  static const st::translate_field_name_table table{
      data::fields_size,
      data::fields_names.data(),
      data::fields_ids.data(),
      data::fields_types.data()};
  st::translate_field_name(_fname, fid, _ftype, table);
}

} // namespace detail
} // namespace thrift
} // namespace apache

namespace cpp2 {

const folly::StringPiece StructWithRef::__fbthrift_get_field_name(::apache::thrift::FieldOrdinal ord) {
  if (ord == ::apache::thrift::FieldOrdinal{0}) { return {}; }
  return apache::thrift::TStructDataStorage<StructWithRef>::fields_names[folly::to_underlying(ord) - 1];
}

StructWithRef::StructWithRef(const StructWithRef& srcObj) :
    __fbthrift_field_def_field(::apache::thrift::detail::st::copy_field<
          ::apache::thrift::type_class::structure>(srcObj.__fbthrift_field_def_field)),
    __fbthrift_field_opt_field(::apache::thrift::detail::st::copy_field<
          ::apache::thrift::type_class::structure>(srcObj.__fbthrift_field_opt_field)),
    __fbthrift_field_req_field(::apache::thrift::detail::st::copy_field<
          ::apache::thrift::type_class::structure>(srcObj.__fbthrift_field_req_field)) {
}

StructWithRef& StructWithRef::operator=(const StructWithRef& other) {
  StructWithRef tmp(other);
  swap(*this, tmp);
  return *this;
}

StructWithRef::StructWithRef(FOLLY_MAYBE_UNUSED StructWithRef&& other) noexcept :
    __fbthrift_field_def_field(std::move(other.__fbthrift_field_def_field)),
    __fbthrift_field_opt_field(std::move(other.__fbthrift_field_opt_field)),
    __fbthrift_field_req_field(std::move(other.__fbthrift_field_req_field)) {
}

StructWithRef& StructWithRef::operator=(FOLLY_MAYBE_UNUSED StructWithRef&& other) noexcept {
    this->__fbthrift_field_def_field = std::move(other.__fbthrift_field_def_field);
    this->__fbthrift_field_opt_field = std::move(other.__fbthrift_field_opt_field);
    this->__fbthrift_field_req_field = std::move(other.__fbthrift_field_req_field);
    return *this;
}

StructWithRef::StructWithRef(apache::thrift::FragileConstructor, ::std::unique_ptr<::cpp2::Empty> def_field__arg, ::std::unique_ptr<::cpp2::Empty> opt_field__arg, ::std::unique_ptr<::cpp2::Empty> req_field__arg) :
    __fbthrift_field_def_field(std::move(def_field__arg)),
    __fbthrift_field_opt_field(std::move(opt_field__arg)),
    __fbthrift_field_req_field(std::move(req_field__arg)) {
}

void StructWithRef::__fbthrift_clear() {
  // clear all fields
}

void StructWithRef::__fbthrift_clear_terse_fields() {
}

bool StructWithRef::__fbthrift_is_empty() const {
  return false;
}

bool StructWithRef::operator==(FOLLY_MAYBE_UNUSED const StructWithRef& rhs) const {
  FOLLY_MAYBE_UNUSED auto& lhs = *this;
  if ((!::apache::thrift::detail::pointer_equal(lhs.def_field_ref(), rhs.def_field_ref()))) {
    return false;
  }
  if ((!::apache::thrift::detail::pointer_equal(lhs.opt_field_ref(), rhs.opt_field_ref()))) {
    return false;
  }
  if ((!::apache::thrift::detail::pointer_equal(lhs.req_field_ref(), rhs.req_field_ref()))) {
    return false;
  }
  return true;
}

bool StructWithRef::operator<(FOLLY_MAYBE_UNUSED const StructWithRef& rhs) const {
  FOLLY_MAYBE_UNUSED auto& lhs = *this;
  if ((!::apache::thrift::detail::pointer_equal(lhs.def_field_ref(), rhs.def_field_ref()))) {
    return ::apache::thrift::detail::pointer_less(lhs.def_field_ref(), rhs.def_field_ref());
  }
  if ((!::apache::thrift::detail::pointer_equal(lhs.opt_field_ref(), rhs.opt_field_ref()))) {
    return ::apache::thrift::detail::pointer_less(lhs.opt_field_ref(), rhs.opt_field_ref());
  }
  if ((!::apache::thrift::detail::pointer_equal(lhs.req_field_ref(), rhs.req_field_ref()))) {
    return ::apache::thrift::detail::pointer_less(lhs.req_field_ref(), rhs.req_field_ref());
  }
  return false;
}

void swap(FOLLY_MAYBE_UNUSED StructWithRef& a, FOLLY_MAYBE_UNUSED StructWithRef& b) {
  using ::std::swap;
  swap(a.__fbthrift_field_def_field, b.__fbthrift_field_def_field);
  swap(a.__fbthrift_field_opt_field, b.__fbthrift_field_opt_field);
  swap(a.__fbthrift_field_req_field, b.__fbthrift_field_req_field);
}

template void StructWithRef::readNoXfer<>(apache::thrift::BinaryProtocolReader*);
template uint32_t StructWithRef::write<>(apache::thrift::BinaryProtocolWriter*) const;
template uint32_t StructWithRef::serializedSize<>(apache::thrift::BinaryProtocolWriter const*) const;
template uint32_t StructWithRef::serializedSizeZC<>(apache::thrift::BinaryProtocolWriter const*) const;
template void StructWithRef::readNoXfer<>(apache::thrift::CompactProtocolReader*);
template uint32_t StructWithRef::write<>(apache::thrift::CompactProtocolWriter*) const;
template uint32_t StructWithRef::serializedSize<>(apache::thrift::CompactProtocolWriter const*) const;
template uint32_t StructWithRef::serializedSizeZC<>(apache::thrift::CompactProtocolWriter const*) const;

static_assert(
    ::apache::thrift::detail::st::gen_check_json<
        StructWithRef,
        ::apache::thrift::type_class::structure,
        ::cpp2::Empty>,
    "inconsistent use of json option");
static_assert(
    ::apache::thrift::detail::st::gen_check_json<
        StructWithRef,
        ::apache::thrift::type_class::structure,
        ::cpp2::Empty>,
    "inconsistent use of json option");
static_assert(
    ::apache::thrift::detail::st::gen_check_json<
        StructWithRef,
        ::apache::thrift::type_class::structure,
        ::cpp2::Empty>,
    "inconsistent use of json option");

} // cpp2

namespace apache {
namespace thrift {
namespace detail {

void TccStructTraits<::cpp2::StructWithBox>::translateFieldName(
    folly::StringPiece _fname,
    int16_t& fid,
    apache::thrift::protocol::TType& _ftype) noexcept {
  using data = apache::thrift::TStructDataStorage<::cpp2::StructWithBox>;
  static const st::translate_field_name_table table{
      data::fields_size,
      data::fields_names.data(),
      data::fields_ids.data(),
      data::fields_types.data()};
  st::translate_field_name(_fname, fid, _ftype, table);
}

} // namespace detail
} // namespace thrift
} // namespace apache

namespace cpp2 {

const folly::StringPiece StructWithBox::__fbthrift_get_field_name(::apache::thrift::FieldOrdinal ord) {
  if (ord == ::apache::thrift::FieldOrdinal{0}) { return {}; }
  return apache::thrift::TStructDataStorage<StructWithBox>::fields_names[folly::to_underlying(ord) - 1];
}

StructWithBox::StructWithBox(const StructWithBox&) = default;
StructWithBox& StructWithBox::operator=(const StructWithBox&) = default;
StructWithBox::StructWithBox(FOLLY_MAYBE_UNUSED StructWithBox&& other) noexcept :
    __fbthrift_field_a(std::move(other.__fbthrift_field_a)),
    __fbthrift_field_b(std::move(other.__fbthrift_field_b)),
    __fbthrift_field_c(std::move(other.__fbthrift_field_c)) {
}

StructWithBox& StructWithBox::operator=(FOLLY_MAYBE_UNUSED StructWithBox&& other) noexcept {
    this->__fbthrift_field_a = std::move(other.__fbthrift_field_a);
    this->__fbthrift_field_b = std::move(other.__fbthrift_field_b);
    this->__fbthrift_field_c = std::move(other.__fbthrift_field_c);
    return *this;
}

StructWithBox::StructWithBox(apache::thrift::FragileConstructor, ::apache::thrift::detail::boxed_value_ptr<::std::string> a__arg, ::apache::thrift::detail::boxed_value_ptr<::std::vector<::std::int64_t>> b__arg, ::apache::thrift::detail::boxed_value_ptr<::cpp2::StructWithRef> c__arg) :
    __fbthrift_field_a(std::move(a__arg)),
    __fbthrift_field_b(std::move(b__arg)),
    __fbthrift_field_c(std::move(c__arg)) {
}

void StructWithBox::__fbthrift_clear() {
  // clear all fields
  this->__fbthrift_field_a.reset();
  this->__fbthrift_field_b.reset();
  this->__fbthrift_field_c.reset();
}

void StructWithBox::__fbthrift_clear_terse_fields() {
}

bool StructWithBox::__fbthrift_is_empty() const {
  return !(this->__fbthrift_field_a) &&
 !(this->__fbthrift_field_b) &&
 !(this->__fbthrift_field_c);
}

bool StructWithBox::operator==(FOLLY_MAYBE_UNUSED const StructWithBox& rhs) const {
  FOLLY_MAYBE_UNUSED auto& lhs = *this;
  if ((!::apache::thrift::detail::pointer_equal(lhs.a_ref(), rhs.a_ref()))) {
    return false;
  }
  if ((!::apache::thrift::detail::pointer_equal(lhs.b_ref(), rhs.b_ref()))) {
    return false;
  }
  if ((!::apache::thrift::detail::pointer_equal(lhs.c_ref(), rhs.c_ref()))) {
    return false;
  }
  return true;
}

bool StructWithBox::operator<(FOLLY_MAYBE_UNUSED const StructWithBox& rhs) const {
  FOLLY_MAYBE_UNUSED auto& lhs = *this;
  if ((!::apache::thrift::detail::pointer_equal(lhs.a_ref(), rhs.a_ref()))) {
    return ::apache::thrift::detail::pointer_less(lhs.a_ref(), rhs.a_ref());
  }
  if ((!::apache::thrift::detail::pointer_equal(lhs.b_ref(), rhs.b_ref()))) {
    return ::apache::thrift::detail::pointer_less(lhs.b_ref(), rhs.b_ref());
  }
  if ((!::apache::thrift::detail::pointer_equal(lhs.c_ref(), rhs.c_ref()))) {
    return ::apache::thrift::detail::pointer_less(lhs.c_ref(), rhs.c_ref());
  }
  return false;
}

void swap(FOLLY_MAYBE_UNUSED StructWithBox& a, FOLLY_MAYBE_UNUSED StructWithBox& b) {
  using ::std::swap;
  swap(a.__fbthrift_field_a, b.__fbthrift_field_a);
  swap(a.__fbthrift_field_b, b.__fbthrift_field_b);
  swap(a.__fbthrift_field_c, b.__fbthrift_field_c);
}

template void StructWithBox::readNoXfer<>(apache::thrift::BinaryProtocolReader*);
template uint32_t StructWithBox::write<>(apache::thrift::BinaryProtocolWriter*) const;
template uint32_t StructWithBox::serializedSize<>(apache::thrift::BinaryProtocolWriter const*) const;
template uint32_t StructWithBox::serializedSizeZC<>(apache::thrift::BinaryProtocolWriter const*) const;
template void StructWithBox::readNoXfer<>(apache::thrift::CompactProtocolReader*);
template uint32_t StructWithBox::write<>(apache::thrift::CompactProtocolWriter*) const;
template uint32_t StructWithBox::serializedSize<>(apache::thrift::CompactProtocolWriter const*) const;
template uint32_t StructWithBox::serializedSizeZC<>(apache::thrift::CompactProtocolWriter const*) const;

static_assert(
    ::apache::thrift::detail::st::gen_check_json<
        StructWithBox,
        ::apache::thrift::type_class::structure,
        ::cpp2::StructWithRef>,
    "inconsistent use of json option");

} // cpp2

namespace apache {
namespace thrift {
namespace detail {

void TccStructTraits<::cpp2::StructWithNonOptionalBox>::translateFieldName(
    folly::StringPiece _fname,
    int16_t& fid,
    apache::thrift::protocol::TType& _ftype) noexcept {
  using data = apache::thrift::TStructDataStorage<::cpp2::StructWithNonOptionalBox>;
  static const st::translate_field_name_table table{
      data::fields_size,
      data::fields_names.data(),
      data::fields_ids.data(),
      data::fields_types.data()};
  st::translate_field_name(_fname, fid, _ftype, table);
}

} // namespace detail
} // namespace thrift
} // namespace apache

namespace cpp2 {

const folly::StringPiece StructWithNonOptionalBox::__fbthrift_get_field_name(::apache::thrift::FieldOrdinal ord) {
  if (ord == ::apache::thrift::FieldOrdinal{0}) { return {}; }
  return apache::thrift::TStructDataStorage<StructWithNonOptionalBox>::fields_names[folly::to_underlying(ord) - 1];
}

StructWithNonOptionalBox::StructWithNonOptionalBox(const StructWithNonOptionalBox&) = default;
StructWithNonOptionalBox& StructWithNonOptionalBox::operator=(const StructWithNonOptionalBox&) = default;
StructWithNonOptionalBox::StructWithNonOptionalBox(FOLLY_MAYBE_UNUSED StructWithNonOptionalBox&& other) noexcept :
    __fbthrift_field_a(std::move(other.__fbthrift_field_a)),
    __fbthrift_field_b(std::move(other.__fbthrift_field_b)),
    __fbthrift_field_c(std::move(other.__fbthrift_field_c)) {
}

StructWithNonOptionalBox& StructWithNonOptionalBox::operator=(FOLLY_MAYBE_UNUSED StructWithNonOptionalBox&& other) noexcept {
    this->__fbthrift_field_a = std::move(other.__fbthrift_field_a);
    this->__fbthrift_field_b = std::move(other.__fbthrift_field_b);
    this->__fbthrift_field_c = std::move(other.__fbthrift_field_c);
    return *this;
}

StructWithNonOptionalBox::StructWithNonOptionalBox(apache::thrift::FragileConstructor, ::apache::thrift::detail::boxed_value_ptr<::std::string> a__arg, ::apache::thrift::detail::boxed_value_ptr<::std::vector<::std::int64_t>> b__arg, ::apache::thrift::detail::boxed_value_ptr<::cpp2::StructWithRef> c__arg) :
    __fbthrift_field_a(std::move(a__arg)),
    __fbthrift_field_b(std::move(b__arg)),
    __fbthrift_field_c(std::move(c__arg)) {
}

void StructWithNonOptionalBox::__fbthrift_clear() {
  // clear all fields
  this->__fbthrift_field_a = apache::thrift::StringTraits<std::string>::fromStringLiteral("");
  this->__fbthrift_field_b = ::std::vector<::std::int64_t>();
  this->__fbthrift_field_c = ::cpp2::StructWithRef();
}

void StructWithNonOptionalBox::__fbthrift_clear_terse_fields() {
}

bool StructWithNonOptionalBox::__fbthrift_is_empty() const {
  return false;
}

bool StructWithNonOptionalBox::operator==(FOLLY_MAYBE_UNUSED const StructWithNonOptionalBox& rhs) const {
  FOLLY_MAYBE_UNUSED auto& lhs = *this;
  if ((!::apache::thrift::detail::pointer_equal(lhs.a_ref(), rhs.a_ref()))) {
    return false;
  }
  if ((!::apache::thrift::detail::pointer_equal(lhs.b_ref(), rhs.b_ref()))) {
    return false;
  }
  if ((!::apache::thrift::detail::pointer_equal(lhs.c_ref(), rhs.c_ref()))) {
    return false;
  }
  return true;
}

bool StructWithNonOptionalBox::operator<(FOLLY_MAYBE_UNUSED const StructWithNonOptionalBox& rhs) const {
  FOLLY_MAYBE_UNUSED auto& lhs = *this;
  if ((!::apache::thrift::detail::pointer_equal(lhs.a_ref(), rhs.a_ref()))) {
    return ::apache::thrift::detail::pointer_less(lhs.a_ref(), rhs.a_ref());
  }
  if ((!::apache::thrift::detail::pointer_equal(lhs.b_ref(), rhs.b_ref()))) {
    return ::apache::thrift::detail::pointer_less(lhs.b_ref(), rhs.b_ref());
  }
  if ((!::apache::thrift::detail::pointer_equal(lhs.c_ref(), rhs.c_ref()))) {
    return ::apache::thrift::detail::pointer_less(lhs.c_ref(), rhs.c_ref());
  }
  return false;
}

void swap(FOLLY_MAYBE_UNUSED StructWithNonOptionalBox& a, FOLLY_MAYBE_UNUSED StructWithNonOptionalBox& b) {
  using ::std::swap;
  swap(a.__fbthrift_field_a, b.__fbthrift_field_a);
  swap(a.__fbthrift_field_b, b.__fbthrift_field_b);
  swap(a.__fbthrift_field_c, b.__fbthrift_field_c);
}

template void StructWithNonOptionalBox::readNoXfer<>(apache::thrift::BinaryProtocolReader*);
template uint32_t StructWithNonOptionalBox::write<>(apache::thrift::BinaryProtocolWriter*) const;
template uint32_t StructWithNonOptionalBox::serializedSize<>(apache::thrift::BinaryProtocolWriter const*) const;
template uint32_t StructWithNonOptionalBox::serializedSizeZC<>(apache::thrift::BinaryProtocolWriter const*) const;
template void StructWithNonOptionalBox::readNoXfer<>(apache::thrift::CompactProtocolReader*);
template uint32_t StructWithNonOptionalBox::write<>(apache::thrift::CompactProtocolWriter*) const;
template uint32_t StructWithNonOptionalBox::serializedSize<>(apache::thrift::CompactProtocolWriter const*) const;
template uint32_t StructWithNonOptionalBox::serializedSizeZC<>(apache::thrift::CompactProtocolWriter const*) const;

static_assert(
    ::apache::thrift::detail::st::gen_check_json<
        StructWithNonOptionalBox,
        ::apache::thrift::type_class::structure,
        ::cpp2::StructWithRef>,
    "inconsistent use of json option");

} // cpp2

namespace apache {
namespace thrift {
namespace detail {

void TccStructTraits<::cpp2::StructWithInternBox>::translateFieldName(
    folly::StringPiece _fname,
    int16_t& fid,
    apache::thrift::protocol::TType& _ftype) noexcept {
  using data = apache::thrift::TStructDataStorage<::cpp2::StructWithInternBox>;
  static const st::translate_field_name_table table{
      data::fields_size,
      data::fields_names.data(),
      data::fields_ids.data(),
      data::fields_types.data()};
  st::translate_field_name(_fname, fid, _ftype, table);
}

} // namespace detail
} // namespace thrift
} // namespace apache

namespace cpp2 {

const folly::StringPiece StructWithInternBox::__fbthrift_get_field_name(::apache::thrift::FieldOrdinal ord) {
  if (ord == ::apache::thrift::FieldOrdinal{0}) { return {}; }
  return apache::thrift::TStructDataStorage<StructWithInternBox>::fields_names[folly::to_underlying(ord) - 1];
}

StructWithInternBox::StructWithInternBox(const StructWithInternBox&) = default;
StructWithInternBox& StructWithInternBox::operator=(const StructWithInternBox&) = default;
StructWithInternBox::StructWithInternBox(FOLLY_MAYBE_UNUSED StructWithInternBox&& other) noexcept :
    __fbthrift_field_field1(std::move(other.__fbthrift_field_field1)),
    __fbthrift_field_field2(std::move(other.__fbthrift_field_field2)),
    __fbthrift_field_field3(std::move(other.__fbthrift_field_field3)),
    __fbthrift_field_field4(std::move(other.__fbthrift_field_field4)),
    __isset(other.__isset) {
}

StructWithInternBox& StructWithInternBox::operator=(FOLLY_MAYBE_UNUSED StructWithInternBox&& other) noexcept {
    this->__fbthrift_field_field1 = std::move(other.__fbthrift_field_field1);
    this->__fbthrift_field_field2 = std::move(other.__fbthrift_field_field2);
    this->__fbthrift_field_field3 = std::move(other.__fbthrift_field_field3);
    this->__fbthrift_field_field4 = std::move(other.__fbthrift_field_field4);
    __isset = other.__isset;
    return *this;
}

StructWithInternBox::StructWithInternBox(apache::thrift::FragileConstructor, ::apache::thrift::detail::boxed_value<::cpp2::Empty> field1__arg, ::apache::thrift::detail::boxed_value<::cpp2::MyField> field2__arg, ::apache::thrift::detail::boxed_value<::cpp2::Empty> field3__arg, ::apache::thrift::detail::boxed_value<::cpp2::MyField> field4__arg) :
    __fbthrift_field_field1(std::move(field1__arg)),
    __fbthrift_field_field2(std::move(field2__arg)),
    __fbthrift_field_field3(std::move(field3__arg)),
    __fbthrift_field_field4(std::move(field4__arg)) {
  __isset.set(folly::index_constant<0>(), true);
  __isset.set(folly::index_constant<1>(), true);
}

void StructWithInternBox::__fbthrift_clear() {
  // clear all fields
  this->__fbthrift_field_field2 = ::apache::thrift::detail::boxed_value<::cpp2::MyField>::fromStaticConstant(&::apache::thrift::op::getIntrinsicDefault<::apache::thrift::type::struct_t<::cpp2::MyField>>());
  this->__fbthrift_field_field4 = ::apache::thrift::detail::boxed_value<::cpp2::MyField>::fromStaticConstant(&::apache::thrift::op::getIntrinsicDefault<::apache::thrift::type::struct_t<::cpp2::MyField>>());
  __isset = {};
}

void StructWithInternBox::__fbthrift_clear_terse_fields() {
  this->__fbthrift_field_field4 = ::apache::thrift::detail::boxed_value<::cpp2::MyField>::fromStaticConstant(&::apache::thrift::op::getIntrinsicDefault<::apache::thrift::type::struct_t<::cpp2::MyField>>());
}

bool StructWithInternBox::__fbthrift_is_empty() const {
  return false;
}

bool StructWithInternBox::operator==(FOLLY_MAYBE_UNUSED const StructWithInternBox& rhs) const {
  FOLLY_MAYBE_UNUSED auto& lhs = *this;
  if (!::apache::thrift::op::equal<::apache::thrift::type::struct_t<::cpp2::Empty>>(*lhs.__fbthrift_field_field1, *rhs.__fbthrift_field_field1)) {
    return false;
  }
  if (!::apache::thrift::op::equal<::apache::thrift::type::struct_t<::cpp2::MyField>>(*lhs.__fbthrift_field_field2, *rhs.__fbthrift_field_field2)) {
    return false;
  }
  if (!::apache::thrift::op::equal<::apache::thrift::type::struct_t<::cpp2::Empty>>(*lhs.__fbthrift_field_field3, *rhs.__fbthrift_field_field3)) {
    return false;
  }
  if (!::apache::thrift::op::equal<::apache::thrift::type::struct_t<::cpp2::MyField>>(*lhs.__fbthrift_field_field4, *rhs.__fbthrift_field_field4)) {
    return false;
  }
  return true;
}

bool StructWithInternBox::operator<(FOLLY_MAYBE_UNUSED const StructWithInternBox& rhs) const {
  FOLLY_MAYBE_UNUSED auto& lhs = *this;
  if (!::apache::thrift::op::equal<::apache::thrift::type::struct_t<::cpp2::Empty>>(*lhs.__fbthrift_field_field1, *rhs.__fbthrift_field_field1)) {
    return ::apache::thrift::op::less<::apache::thrift::type::struct_t<::cpp2::Empty>>(*lhs.__fbthrift_field_field1, *rhs.__fbthrift_field_field1);
  }
  if (!::apache::thrift::op::equal<::apache::thrift::type::struct_t<::cpp2::MyField>>(*lhs.__fbthrift_field_field2, *rhs.__fbthrift_field_field2)) {
    return ::apache::thrift::op::less<::apache::thrift::type::struct_t<::cpp2::MyField>>(*lhs.__fbthrift_field_field2, *rhs.__fbthrift_field_field2);
  }
  if (!::apache::thrift::op::equal<::apache::thrift::type::struct_t<::cpp2::Empty>>(*lhs.__fbthrift_field_field3, *rhs.__fbthrift_field_field3)) {
    return ::apache::thrift::op::less<::apache::thrift::type::struct_t<::cpp2::Empty>>(*lhs.__fbthrift_field_field3, *rhs.__fbthrift_field_field3);
  }
  if (!::apache::thrift::op::equal<::apache::thrift::type::struct_t<::cpp2::MyField>>(*lhs.__fbthrift_field_field4, *rhs.__fbthrift_field_field4)) {
    return ::apache::thrift::op::less<::apache::thrift::type::struct_t<::cpp2::MyField>>(*lhs.__fbthrift_field_field4, *rhs.__fbthrift_field_field4);
  }
  return false;
}

void swap(FOLLY_MAYBE_UNUSED StructWithInternBox& a, FOLLY_MAYBE_UNUSED StructWithInternBox& b) {
  using ::std::swap;
  swap(a.__fbthrift_field_field1, b.__fbthrift_field_field1);
  swap(a.__fbthrift_field_field2, b.__fbthrift_field_field2);
  swap(a.__fbthrift_field_field3, b.__fbthrift_field_field3);
  swap(a.__fbthrift_field_field4, b.__fbthrift_field_field4);
  swap(a.__isset, b.__isset);
}

template void StructWithInternBox::readNoXfer<>(apache::thrift::BinaryProtocolReader*);
template uint32_t StructWithInternBox::write<>(apache::thrift::BinaryProtocolWriter*) const;
template uint32_t StructWithInternBox::serializedSize<>(apache::thrift::BinaryProtocolWriter const*) const;
template uint32_t StructWithInternBox::serializedSizeZC<>(apache::thrift::BinaryProtocolWriter const*) const;
template void StructWithInternBox::readNoXfer<>(apache::thrift::CompactProtocolReader*);
template uint32_t StructWithInternBox::write<>(apache::thrift::CompactProtocolWriter*) const;
template uint32_t StructWithInternBox::serializedSize<>(apache::thrift::CompactProtocolWriter const*) const;
template uint32_t StructWithInternBox::serializedSizeZC<>(apache::thrift::CompactProtocolWriter const*) const;

static_assert(
    ::apache::thrift::detail::st::gen_check_json<
        StructWithInternBox,
        ::apache::thrift::type_class::structure,
        ::cpp2::Empty>,
    "inconsistent use of json option");
static_assert(
    ::apache::thrift::detail::st::gen_check_json<
        StructWithInternBox,
        ::apache::thrift::type_class::structure,
        ::cpp2::MyField>,
    "inconsistent use of json option");
static_assert(
    ::apache::thrift::detail::st::gen_check_json<
        StructWithInternBox,
        ::apache::thrift::type_class::structure,
        ::cpp2::Empty>,
    "inconsistent use of json option");
static_assert(
    ::apache::thrift::detail::st::gen_check_json<
        StructWithInternBox,
        ::apache::thrift::type_class::structure,
        ::cpp2::MyField>,
    "inconsistent use of json option");

} // cpp2

namespace apache {
namespace thrift {
namespace detail {

void TccStructTraits<::cpp2::AdaptedStructWithInternBox>::translateFieldName(
    folly::StringPiece _fname,
    int16_t& fid,
    apache::thrift::protocol::TType& _ftype) noexcept {
  using data = apache::thrift::TStructDataStorage<::cpp2::AdaptedStructWithInternBox>;
  static const st::translate_field_name_table table{
      data::fields_size,
      data::fields_names.data(),
      data::fields_ids.data(),
      data::fields_types.data()};
  st::translate_field_name(_fname, fid, _ftype, table);
}

} // namespace detail
} // namespace thrift
} // namespace apache

namespace cpp2 {

const folly::StringPiece AdaptedStructWithInternBox::__fbthrift_get_field_name(::apache::thrift::FieldOrdinal ord) {
  if (ord == ::apache::thrift::FieldOrdinal{0}) { return {}; }
  return apache::thrift::TStructDataStorage<AdaptedStructWithInternBox>::fields_names[folly::to_underlying(ord) - 1];
}

AdaptedStructWithInternBox::AdaptedStructWithInternBox(const AdaptedStructWithInternBox& srcObj) :
    __fbthrift_field_field1(srcObj.__fbthrift_field_field1),
    __fbthrift_field_field2(srcObj.__fbthrift_field_field2),
    __fbthrift_field_field3(srcObj.__fbthrift_field_field3),
    __fbthrift_field_field4(srcObj.__fbthrift_field_field4),
    __isset(srcObj.__isset) {
  ::apache::thrift::adapt_detail::construct<::my::Adapter1, 1>(*__fbthrift_field_field1, *this);
  ::apache::thrift::adapt_detail::construct<::my::Adapter1, 2>(*__fbthrift_field_field2, *this);
  ::apache::thrift::adapt_detail::construct<::my::Adapter1, 3>(*__fbthrift_field_field3, *this);
  ::apache::thrift::adapt_detail::construct<::my::Adapter1, 4>(*__fbthrift_field_field4, *this);
}

AdaptedStructWithInternBox& AdaptedStructWithInternBox::operator=(const AdaptedStructWithInternBox& other) {
  AdaptedStructWithInternBox tmp(other);
  swap(*this, tmp);
  return *this;
}

AdaptedStructWithInternBox::AdaptedStructWithInternBox(FOLLY_MAYBE_UNUSED AdaptedStructWithInternBox&& other) noexcept :
    __fbthrift_field_field1(std::move(other.__fbthrift_field_field1)),
    __fbthrift_field_field2(std::move(other.__fbthrift_field_field2)),
    __fbthrift_field_field3(std::move(other.__fbthrift_field_field3)),
    __fbthrift_field_field4(std::move(other.__fbthrift_field_field4)),
    __isset(other.__isset) {
  ::apache::thrift::adapt_detail::construct<::my::Adapter1, 1>(*__fbthrift_field_field1, *this);
  ::apache::thrift::adapt_detail::construct<::my::Adapter1, 2>(*__fbthrift_field_field2, *this);
  ::apache::thrift::adapt_detail::construct<::my::Adapter1, 3>(*__fbthrift_field_field3, *this);
  ::apache::thrift::adapt_detail::construct<::my::Adapter1, 4>(*__fbthrift_field_field4, *this);
}

AdaptedStructWithInternBox& AdaptedStructWithInternBox::operator=(FOLLY_MAYBE_UNUSED AdaptedStructWithInternBox&& other) noexcept {
    this->__fbthrift_field_field1 = std::move(other.__fbthrift_field_field1);
    this->__fbthrift_field_field2 = std::move(other.__fbthrift_field_field2);
    this->__fbthrift_field_field3 = std::move(other.__fbthrift_field_field3);
    this->__fbthrift_field_field4 = std::move(other.__fbthrift_field_field4);
    __isset = other.__isset;
    return *this;
}

AdaptedStructWithInternBox::AdaptedStructWithInternBox(apache::thrift::FragileConstructor, ::apache::thrift::detail::boxed_value<::apache::thrift::adapt_detail::adapted_field_t<::my::Adapter1, 1, ::cpp2::Empty, AdaptedStructWithInternBox>> field1__arg, ::apache::thrift::detail::boxed_value<::apache::thrift::adapt_detail::adapted_field_t<::my::Adapter1, 2, ::cpp2::MyField, AdaptedStructWithInternBox>> field2__arg, ::apache::thrift::detail::boxed_value<::apache::thrift::adapt_detail::adapted_field_t<::my::Adapter1, 3, ::cpp2::Empty, AdaptedStructWithInternBox>> field3__arg, ::apache::thrift::detail::boxed_value<::apache::thrift::adapt_detail::adapted_field_t<::my::Adapter1, 4, ::cpp2::MyField, AdaptedStructWithInternBox>> field4__arg) :
    __fbthrift_field_field1(std::move(field1__arg)),
    __fbthrift_field_field2(std::move(field2__arg)),
    __fbthrift_field_field3(std::move(field3__arg)),
    __fbthrift_field_field4(std::move(field4__arg)) {
  ::apache::thrift::adapt_detail::construct<::my::Adapter1, 1>(*__fbthrift_field_field1, *this);
  ::apache::thrift::adapt_detail::construct<::my::Adapter1, 2>(*__fbthrift_field_field2, *this);
  ::apache::thrift::adapt_detail::construct<::my::Adapter1, 3>(*__fbthrift_field_field3, *this);
  ::apache::thrift::adapt_detail::construct<::my::Adapter1, 4>(*__fbthrift_field_field4, *this);
  __isset.set(folly::index_constant<0>(), true);
  __isset.set(folly::index_constant<1>(), true);
}

void AdaptedStructWithInternBox::__fbthrift_clear() {
  // clear all fields
  this->__fbthrift_field_field2 = ::apache::thrift::detail::boxed_value<::apache::thrift::adapt_detail::adapted_field_t<::my::Adapter1, 2, ::cpp2::MyField, AdaptedStructWithInternBox>>::fromStaticConstant(&::apache::thrift::op::getIntrinsicDefault<::apache::thrift::op::get_field_tag<::apache::thrift::field_id<2>, AdaptedStructWithInternBox>>());
  this->__fbthrift_field_field4 = ::apache::thrift::detail::boxed_value<::apache::thrift::adapt_detail::adapted_field_t<::my::Adapter1, 4, ::cpp2::MyField, AdaptedStructWithInternBox>>::fromStaticConstant(&::apache::thrift::op::getIntrinsicDefault<::apache::thrift::op::get_field_tag<::apache::thrift::field_id<4>, AdaptedStructWithInternBox>>());
  __isset = {};
}

void AdaptedStructWithInternBox::__fbthrift_clear_terse_fields() {
  this->__fbthrift_field_field4 = ::apache::thrift::detail::boxed_value<::apache::thrift::adapt_detail::adapted_field_t<::my::Adapter1, 4, ::cpp2::MyField, AdaptedStructWithInternBox>>::fromStaticConstant(&::apache::thrift::op::getIntrinsicDefault<::apache::thrift::op::get_field_tag<::apache::thrift::field_id<4>, AdaptedStructWithInternBox>>());
}

bool AdaptedStructWithInternBox::__fbthrift_is_empty() const {
  return false;
}

bool AdaptedStructWithInternBox::operator==(FOLLY_MAYBE_UNUSED const AdaptedStructWithInternBox& rhs) const {
  FOLLY_MAYBE_UNUSED auto& lhs = *this;
  if (!::apache::thrift::op::equal<::apache::thrift::type::adapted<::my::Adapter1, ::apache::thrift::type::struct_t<::cpp2::Empty>>>(*lhs.__fbthrift_field_field1, *rhs.__fbthrift_field_field1)) {
    return false;
  }
  if (!::apache::thrift::op::equal<::apache::thrift::type::adapted<::my::Adapter1, ::apache::thrift::type::struct_t<::cpp2::MyField>>>(*lhs.__fbthrift_field_field2, *rhs.__fbthrift_field_field2)) {
    return false;
  }
  if (!::apache::thrift::op::equal<::apache::thrift::type::adapted<::my::Adapter1, ::apache::thrift::type::struct_t<::cpp2::Empty>>>(*lhs.__fbthrift_field_field3, *rhs.__fbthrift_field_field3)) {
    return false;
  }
  if (!::apache::thrift::op::equal<::apache::thrift::type::adapted<::my::Adapter1, ::apache::thrift::type::struct_t<::cpp2::MyField>>>(*lhs.__fbthrift_field_field4, *rhs.__fbthrift_field_field4)) {
    return false;
  }
  return true;
}

bool AdaptedStructWithInternBox::operator<(FOLLY_MAYBE_UNUSED const AdaptedStructWithInternBox& rhs) const {
  FOLLY_MAYBE_UNUSED auto& lhs = *this;
  if (!::apache::thrift::op::equal<::apache::thrift::type::adapted<::my::Adapter1, ::apache::thrift::type::struct_t<::cpp2::Empty>>>(*lhs.__fbthrift_field_field1, *rhs.__fbthrift_field_field1)) {
    return ::apache::thrift::op::less<::apache::thrift::type::adapted<::my::Adapter1, ::apache::thrift::type::struct_t<::cpp2::Empty>>>(*lhs.__fbthrift_field_field1, *rhs.__fbthrift_field_field1);
  }
  if (!::apache::thrift::op::equal<::apache::thrift::type::adapted<::my::Adapter1, ::apache::thrift::type::struct_t<::cpp2::MyField>>>(*lhs.__fbthrift_field_field2, *rhs.__fbthrift_field_field2)) {
    return ::apache::thrift::op::less<::apache::thrift::type::adapted<::my::Adapter1, ::apache::thrift::type::struct_t<::cpp2::MyField>>>(*lhs.__fbthrift_field_field2, *rhs.__fbthrift_field_field2);
  }
  if (!::apache::thrift::op::equal<::apache::thrift::type::adapted<::my::Adapter1, ::apache::thrift::type::struct_t<::cpp2::Empty>>>(*lhs.__fbthrift_field_field3, *rhs.__fbthrift_field_field3)) {
    return ::apache::thrift::op::less<::apache::thrift::type::adapted<::my::Adapter1, ::apache::thrift::type::struct_t<::cpp2::Empty>>>(*lhs.__fbthrift_field_field3, *rhs.__fbthrift_field_field3);
  }
  if (!::apache::thrift::op::equal<::apache::thrift::type::adapted<::my::Adapter1, ::apache::thrift::type::struct_t<::cpp2::MyField>>>(*lhs.__fbthrift_field_field4, *rhs.__fbthrift_field_field4)) {
    return ::apache::thrift::op::less<::apache::thrift::type::adapted<::my::Adapter1, ::apache::thrift::type::struct_t<::cpp2::MyField>>>(*lhs.__fbthrift_field_field4, *rhs.__fbthrift_field_field4);
  }
  return false;
}

void swap(FOLLY_MAYBE_UNUSED AdaptedStructWithInternBox& a, FOLLY_MAYBE_UNUSED AdaptedStructWithInternBox& b) {
  using ::std::swap;
  swap(a.__fbthrift_field_field1, b.__fbthrift_field_field1);
  swap(a.__fbthrift_field_field2, b.__fbthrift_field_field2);
  swap(a.__fbthrift_field_field3, b.__fbthrift_field_field3);
  swap(a.__fbthrift_field_field4, b.__fbthrift_field_field4);
  swap(a.__isset, b.__isset);
}

template void AdaptedStructWithInternBox::readNoXfer<>(apache::thrift::BinaryProtocolReader*);
template uint32_t AdaptedStructWithInternBox::write<>(apache::thrift::BinaryProtocolWriter*) const;
template uint32_t AdaptedStructWithInternBox::serializedSize<>(apache::thrift::BinaryProtocolWriter const*) const;
template uint32_t AdaptedStructWithInternBox::serializedSizeZC<>(apache::thrift::BinaryProtocolWriter const*) const;
template void AdaptedStructWithInternBox::readNoXfer<>(apache::thrift::CompactProtocolReader*);
template uint32_t AdaptedStructWithInternBox::write<>(apache::thrift::CompactProtocolWriter*) const;
template uint32_t AdaptedStructWithInternBox::serializedSize<>(apache::thrift::CompactProtocolWriter const*) const;
template uint32_t AdaptedStructWithInternBox::serializedSizeZC<>(apache::thrift::CompactProtocolWriter const*) const;

static_assert(
    ::apache::thrift::detail::st::gen_check_json<
        AdaptedStructWithInternBox,
        ::apache::thrift::type_class::structure,
        ::cpp2::Empty>,
    "inconsistent use of json option");
static_assert(
    ::apache::thrift::detail::st::gen_check_json<
        AdaptedStructWithInternBox,
        ::apache::thrift::type_class::structure,
        ::cpp2::MyField>,
    "inconsistent use of json option");
static_assert(
    ::apache::thrift::detail::st::gen_check_json<
        AdaptedStructWithInternBox,
        ::apache::thrift::type_class::structure,
        ::cpp2::Empty>,
    "inconsistent use of json option");
static_assert(
    ::apache::thrift::detail::st::gen_check_json<
        AdaptedStructWithInternBox,
        ::apache::thrift::type_class::structure,
        ::cpp2::MyField>,
    "inconsistent use of json option");

} // cpp2

namespace apache {
namespace thrift {
namespace detail {

void TccStructTraits<::cpp2::StructWithRefTypeUnique>::translateFieldName(
    folly::StringPiece _fname,
    int16_t& fid,
    apache::thrift::protocol::TType& _ftype) noexcept {
  using data = apache::thrift::TStructDataStorage<::cpp2::StructWithRefTypeUnique>;
  static const st::translate_field_name_table table{
      data::fields_size,
      data::fields_names.data(),
      data::fields_ids.data(),
      data::fields_types.data()};
  st::translate_field_name(_fname, fid, _ftype, table);
}

} // namespace detail
} // namespace thrift
} // namespace apache

namespace cpp2 {

const folly::StringPiece StructWithRefTypeUnique::__fbthrift_get_field_name(::apache::thrift::FieldOrdinal ord) {
  if (ord == ::apache::thrift::FieldOrdinal{0}) { return {}; }
  return apache::thrift::TStructDataStorage<StructWithRefTypeUnique>::fields_names[folly::to_underlying(ord) - 1];
}

StructWithRefTypeUnique::StructWithRefTypeUnique(const StructWithRefTypeUnique& srcObj) :
    __fbthrift_field_def_field(::apache::thrift::detail::st::copy_field<
          ::apache::thrift::type_class::structure>(srcObj.__fbthrift_field_def_field)),
    __fbthrift_field_opt_field(::apache::thrift::detail::st::copy_field<
          ::apache::thrift::type_class::structure>(srcObj.__fbthrift_field_opt_field)),
    __fbthrift_field_req_field(::apache::thrift::detail::st::copy_field<
          ::apache::thrift::type_class::structure>(srcObj.__fbthrift_field_req_field)) {
}

StructWithRefTypeUnique& StructWithRefTypeUnique::operator=(const StructWithRefTypeUnique& other) {
  StructWithRefTypeUnique tmp(other);
  swap(*this, tmp);
  return *this;
}

StructWithRefTypeUnique::StructWithRefTypeUnique(FOLLY_MAYBE_UNUSED StructWithRefTypeUnique&& other) noexcept :
    __fbthrift_field_def_field(std::move(other.__fbthrift_field_def_field)),
    __fbthrift_field_opt_field(std::move(other.__fbthrift_field_opt_field)),
    __fbthrift_field_req_field(std::move(other.__fbthrift_field_req_field)) {
}

StructWithRefTypeUnique& StructWithRefTypeUnique::operator=(FOLLY_MAYBE_UNUSED StructWithRefTypeUnique&& other) noexcept {
    this->__fbthrift_field_def_field = std::move(other.__fbthrift_field_def_field);
    this->__fbthrift_field_opt_field = std::move(other.__fbthrift_field_opt_field);
    this->__fbthrift_field_req_field = std::move(other.__fbthrift_field_req_field);
    return *this;
}

StructWithRefTypeUnique::StructWithRefTypeUnique(apache::thrift::FragileConstructor, ::std::unique_ptr<::cpp2::Empty> def_field__arg, ::std::unique_ptr<::cpp2::Empty> opt_field__arg, ::std::unique_ptr<::cpp2::Empty> req_field__arg) :
    __fbthrift_field_def_field(std::move(def_field__arg)),
    __fbthrift_field_opt_field(std::move(opt_field__arg)),
    __fbthrift_field_req_field(std::move(req_field__arg)) {
}

void StructWithRefTypeUnique::__fbthrift_clear() {
  // clear all fields
}

void StructWithRefTypeUnique::__fbthrift_clear_terse_fields() {
}

bool StructWithRefTypeUnique::__fbthrift_is_empty() const {
  return false;
}

bool StructWithRefTypeUnique::operator==(FOLLY_MAYBE_UNUSED const StructWithRefTypeUnique& rhs) const {
  FOLLY_MAYBE_UNUSED auto& lhs = *this;
  if ((!::apache::thrift::detail::pointer_equal(lhs.def_field_ref(), rhs.def_field_ref()))) {
    return false;
  }
  if ((!::apache::thrift::detail::pointer_equal(lhs.opt_field_ref(), rhs.opt_field_ref()))) {
    return false;
  }
  if ((!::apache::thrift::detail::pointer_equal(lhs.req_field_ref(), rhs.req_field_ref()))) {
    return false;
  }
  return true;
}

bool StructWithRefTypeUnique::operator<(FOLLY_MAYBE_UNUSED const StructWithRefTypeUnique& rhs) const {
  FOLLY_MAYBE_UNUSED auto& lhs = *this;
  if ((!::apache::thrift::detail::pointer_equal(lhs.def_field_ref(), rhs.def_field_ref()))) {
    return ::apache::thrift::detail::pointer_less(lhs.def_field_ref(), rhs.def_field_ref());
  }
  if ((!::apache::thrift::detail::pointer_equal(lhs.opt_field_ref(), rhs.opt_field_ref()))) {
    return ::apache::thrift::detail::pointer_less(lhs.opt_field_ref(), rhs.opt_field_ref());
  }
  if ((!::apache::thrift::detail::pointer_equal(lhs.req_field_ref(), rhs.req_field_ref()))) {
    return ::apache::thrift::detail::pointer_less(lhs.req_field_ref(), rhs.req_field_ref());
  }
  return false;
}

void swap(FOLLY_MAYBE_UNUSED StructWithRefTypeUnique& a, FOLLY_MAYBE_UNUSED StructWithRefTypeUnique& b) {
  using ::std::swap;
  swap(a.__fbthrift_field_def_field, b.__fbthrift_field_def_field);
  swap(a.__fbthrift_field_opt_field, b.__fbthrift_field_opt_field);
  swap(a.__fbthrift_field_req_field, b.__fbthrift_field_req_field);
}

template void StructWithRefTypeUnique::readNoXfer<>(apache::thrift::BinaryProtocolReader*);
template uint32_t StructWithRefTypeUnique::write<>(apache::thrift::BinaryProtocolWriter*) const;
template uint32_t StructWithRefTypeUnique::serializedSize<>(apache::thrift::BinaryProtocolWriter const*) const;
template uint32_t StructWithRefTypeUnique::serializedSizeZC<>(apache::thrift::BinaryProtocolWriter const*) const;
template void StructWithRefTypeUnique::readNoXfer<>(apache::thrift::CompactProtocolReader*);
template uint32_t StructWithRefTypeUnique::write<>(apache::thrift::CompactProtocolWriter*) const;
template uint32_t StructWithRefTypeUnique::serializedSize<>(apache::thrift::CompactProtocolWriter const*) const;
template uint32_t StructWithRefTypeUnique::serializedSizeZC<>(apache::thrift::CompactProtocolWriter const*) const;

static_assert(
    ::apache::thrift::detail::st::gen_check_json<
        StructWithRefTypeUnique,
        ::apache::thrift::type_class::structure,
        ::cpp2::Empty>,
    "inconsistent use of json option");
static_assert(
    ::apache::thrift::detail::st::gen_check_json<
        StructWithRefTypeUnique,
        ::apache::thrift::type_class::structure,
        ::cpp2::Empty>,
    "inconsistent use of json option");
static_assert(
    ::apache::thrift::detail::st::gen_check_json<
        StructWithRefTypeUnique,
        ::apache::thrift::type_class::structure,
        ::cpp2::Empty>,
    "inconsistent use of json option");

} // cpp2

namespace apache {
namespace thrift {
namespace detail {

void TccStructTraits<::cpp2::StructWithRefTypeShared>::translateFieldName(
    folly::StringPiece _fname,
    int16_t& fid,
    apache::thrift::protocol::TType& _ftype) noexcept {
  using data = apache::thrift::TStructDataStorage<::cpp2::StructWithRefTypeShared>;
  static const st::translate_field_name_table table{
      data::fields_size,
      data::fields_names.data(),
      data::fields_ids.data(),
      data::fields_types.data()};
  st::translate_field_name(_fname, fid, _ftype, table);
}

} // namespace detail
} // namespace thrift
} // namespace apache

namespace cpp2 {

const folly::StringPiece StructWithRefTypeShared::__fbthrift_get_field_name(::apache::thrift::FieldOrdinal ord) {
  if (ord == ::apache::thrift::FieldOrdinal{0}) { return {}; }
  return apache::thrift::TStructDataStorage<StructWithRefTypeShared>::fields_names[folly::to_underlying(ord) - 1];
}

StructWithRefTypeShared::StructWithRefTypeShared(const StructWithRefTypeShared&) = default;
StructWithRefTypeShared& StructWithRefTypeShared::operator=(const StructWithRefTypeShared&) = default;
StructWithRefTypeShared::StructWithRefTypeShared(FOLLY_MAYBE_UNUSED StructWithRefTypeShared&& other) noexcept :
    __fbthrift_field_def_field(std::move(other.__fbthrift_field_def_field)),
    __fbthrift_field_opt_field(std::move(other.__fbthrift_field_opt_field)),
    __fbthrift_field_req_field(std::move(other.__fbthrift_field_req_field)) {
}

StructWithRefTypeShared& StructWithRefTypeShared::operator=(FOLLY_MAYBE_UNUSED StructWithRefTypeShared&& other) noexcept {
    this->__fbthrift_field_def_field = std::move(other.__fbthrift_field_def_field);
    this->__fbthrift_field_opt_field = std::move(other.__fbthrift_field_opt_field);
    this->__fbthrift_field_req_field = std::move(other.__fbthrift_field_req_field);
    return *this;
}

StructWithRefTypeShared::StructWithRefTypeShared(apache::thrift::FragileConstructor, ::std::shared_ptr<::cpp2::Empty> def_field__arg, ::std::shared_ptr<::cpp2::Empty> opt_field__arg, ::std::shared_ptr<::cpp2::Empty> req_field__arg) :
    __fbthrift_field_def_field(std::move(def_field__arg)),
    __fbthrift_field_opt_field(std::move(opt_field__arg)),
    __fbthrift_field_req_field(std::move(req_field__arg)) {
}

void StructWithRefTypeShared::__fbthrift_clear() {
  // clear all fields
}

void StructWithRefTypeShared::__fbthrift_clear_terse_fields() {
}

bool StructWithRefTypeShared::__fbthrift_is_empty() const {
  return false;
}

bool StructWithRefTypeShared::operator==(FOLLY_MAYBE_UNUSED const StructWithRefTypeShared& rhs) const {
  FOLLY_MAYBE_UNUSED auto& lhs = *this;
  if ((!::apache::thrift::detail::pointer_equal(lhs.def_field_ref(), rhs.def_field_ref()))) {
    return false;
  }
  if ((!::apache::thrift::detail::pointer_equal(lhs.opt_field_ref(), rhs.opt_field_ref()))) {
    return false;
  }
  if ((!::apache::thrift::detail::pointer_equal(lhs.req_field_ref(), rhs.req_field_ref()))) {
    return false;
  }
  return true;
}

bool StructWithRefTypeShared::operator<(FOLLY_MAYBE_UNUSED const StructWithRefTypeShared& rhs) const {
  FOLLY_MAYBE_UNUSED auto& lhs = *this;
  if ((!::apache::thrift::detail::pointer_equal(lhs.def_field_ref(), rhs.def_field_ref()))) {
    return ::apache::thrift::detail::pointer_less(lhs.def_field_ref(), rhs.def_field_ref());
  }
  if ((!::apache::thrift::detail::pointer_equal(lhs.opt_field_ref(), rhs.opt_field_ref()))) {
    return ::apache::thrift::detail::pointer_less(lhs.opt_field_ref(), rhs.opt_field_ref());
  }
  if ((!::apache::thrift::detail::pointer_equal(lhs.req_field_ref(), rhs.req_field_ref()))) {
    return ::apache::thrift::detail::pointer_less(lhs.req_field_ref(), rhs.req_field_ref());
  }
  return false;
}

void swap(FOLLY_MAYBE_UNUSED StructWithRefTypeShared& a, FOLLY_MAYBE_UNUSED StructWithRefTypeShared& b) {
  using ::std::swap;
  swap(a.__fbthrift_field_def_field, b.__fbthrift_field_def_field);
  swap(a.__fbthrift_field_opt_field, b.__fbthrift_field_opt_field);
  swap(a.__fbthrift_field_req_field, b.__fbthrift_field_req_field);
}

template void StructWithRefTypeShared::readNoXfer<>(apache::thrift::BinaryProtocolReader*);
template uint32_t StructWithRefTypeShared::write<>(apache::thrift::BinaryProtocolWriter*) const;
template uint32_t StructWithRefTypeShared::serializedSize<>(apache::thrift::BinaryProtocolWriter const*) const;
template uint32_t StructWithRefTypeShared::serializedSizeZC<>(apache::thrift::BinaryProtocolWriter const*) const;
template void StructWithRefTypeShared::readNoXfer<>(apache::thrift::CompactProtocolReader*);
template uint32_t StructWithRefTypeShared::write<>(apache::thrift::CompactProtocolWriter*) const;
template uint32_t StructWithRefTypeShared::serializedSize<>(apache::thrift::CompactProtocolWriter const*) const;
template uint32_t StructWithRefTypeShared::serializedSizeZC<>(apache::thrift::CompactProtocolWriter const*) const;

static_assert(
    ::apache::thrift::detail::st::gen_check_json<
        StructWithRefTypeShared,
        ::apache::thrift::type_class::structure,
        ::cpp2::Empty>,
    "inconsistent use of json option");
static_assert(
    ::apache::thrift::detail::st::gen_check_json<
        StructWithRefTypeShared,
        ::apache::thrift::type_class::structure,
        ::cpp2::Empty>,
    "inconsistent use of json option");
static_assert(
    ::apache::thrift::detail::st::gen_check_json<
        StructWithRefTypeShared,
        ::apache::thrift::type_class::structure,
        ::cpp2::Empty>,
    "inconsistent use of json option");

} // cpp2

namespace apache {
namespace thrift {
namespace detail {

void TccStructTraits<::cpp2::StructWithRefTypeSharedConst>::translateFieldName(
    folly::StringPiece _fname,
    int16_t& fid,
    apache::thrift::protocol::TType& _ftype) noexcept {
  using data = apache::thrift::TStructDataStorage<::cpp2::StructWithRefTypeSharedConst>;
  static const st::translate_field_name_table table{
      data::fields_size,
      data::fields_names.data(),
      data::fields_ids.data(),
      data::fields_types.data()};
  st::translate_field_name(_fname, fid, _ftype, table);
}

} // namespace detail
} // namespace thrift
} // namespace apache

namespace cpp2 {

const folly::StringPiece StructWithRefTypeSharedConst::__fbthrift_get_field_name(::apache::thrift::FieldOrdinal ord) {
  if (ord == ::apache::thrift::FieldOrdinal{0}) { return {}; }
  return apache::thrift::TStructDataStorage<StructWithRefTypeSharedConst>::fields_names[folly::to_underlying(ord) - 1];
}

StructWithRefTypeSharedConst::StructWithRefTypeSharedConst(const StructWithRefTypeSharedConst&) = default;
StructWithRefTypeSharedConst& StructWithRefTypeSharedConst::operator=(const StructWithRefTypeSharedConst&) = default;
StructWithRefTypeSharedConst::StructWithRefTypeSharedConst(FOLLY_MAYBE_UNUSED StructWithRefTypeSharedConst&& other) noexcept :
    __fbthrift_field_def_field(std::move(other.__fbthrift_field_def_field)),
    __fbthrift_field_opt_field(std::move(other.__fbthrift_field_opt_field)),
    __fbthrift_field_req_field(std::move(other.__fbthrift_field_req_field)) {
}

StructWithRefTypeSharedConst& StructWithRefTypeSharedConst::operator=(FOLLY_MAYBE_UNUSED StructWithRefTypeSharedConst&& other) noexcept {
    this->__fbthrift_field_def_field = std::move(other.__fbthrift_field_def_field);
    this->__fbthrift_field_opt_field = std::move(other.__fbthrift_field_opt_field);
    this->__fbthrift_field_req_field = std::move(other.__fbthrift_field_req_field);
    return *this;
}

StructWithRefTypeSharedConst::StructWithRefTypeSharedConst(apache::thrift::FragileConstructor, ::std::shared_ptr<const ::cpp2::Empty> def_field__arg, ::std::shared_ptr<const ::cpp2::Empty> opt_field__arg, ::std::shared_ptr<const ::cpp2::Empty> req_field__arg) :
    __fbthrift_field_def_field(std::move(def_field__arg)),
    __fbthrift_field_opt_field(std::move(opt_field__arg)),
    __fbthrift_field_req_field(std::move(req_field__arg)) {
}

void StructWithRefTypeSharedConst::__fbthrift_clear() {
  // clear all fields
}

void StructWithRefTypeSharedConst::__fbthrift_clear_terse_fields() {
}

bool StructWithRefTypeSharedConst::__fbthrift_is_empty() const {
  return false;
}

bool StructWithRefTypeSharedConst::operator==(FOLLY_MAYBE_UNUSED const StructWithRefTypeSharedConst& rhs) const {
  FOLLY_MAYBE_UNUSED auto& lhs = *this;
  if ((!::apache::thrift::detail::pointer_equal(lhs.def_field_ref(), rhs.def_field_ref()))) {
    return false;
  }
  if ((!::apache::thrift::detail::pointer_equal(lhs.opt_field_ref(), rhs.opt_field_ref()))) {
    return false;
  }
  if ((!::apache::thrift::detail::pointer_equal(lhs.req_field_ref(), rhs.req_field_ref()))) {
    return false;
  }
  return true;
}

bool StructWithRefTypeSharedConst::operator<(FOLLY_MAYBE_UNUSED const StructWithRefTypeSharedConst& rhs) const {
  FOLLY_MAYBE_UNUSED auto& lhs = *this;
  if ((!::apache::thrift::detail::pointer_equal(lhs.def_field_ref(), rhs.def_field_ref()))) {
    return ::apache::thrift::detail::pointer_less(lhs.def_field_ref(), rhs.def_field_ref());
  }
  if ((!::apache::thrift::detail::pointer_equal(lhs.opt_field_ref(), rhs.opt_field_ref()))) {
    return ::apache::thrift::detail::pointer_less(lhs.opt_field_ref(), rhs.opt_field_ref());
  }
  if ((!::apache::thrift::detail::pointer_equal(lhs.req_field_ref(), rhs.req_field_ref()))) {
    return ::apache::thrift::detail::pointer_less(lhs.req_field_ref(), rhs.req_field_ref());
  }
  return false;
}

void swap(FOLLY_MAYBE_UNUSED StructWithRefTypeSharedConst& a, FOLLY_MAYBE_UNUSED StructWithRefTypeSharedConst& b) {
  using ::std::swap;
  swap(a.__fbthrift_field_def_field, b.__fbthrift_field_def_field);
  swap(a.__fbthrift_field_opt_field, b.__fbthrift_field_opt_field);
  swap(a.__fbthrift_field_req_field, b.__fbthrift_field_req_field);
}

template void StructWithRefTypeSharedConst::readNoXfer<>(apache::thrift::BinaryProtocolReader*);
template uint32_t StructWithRefTypeSharedConst::write<>(apache::thrift::BinaryProtocolWriter*) const;
template uint32_t StructWithRefTypeSharedConst::serializedSize<>(apache::thrift::BinaryProtocolWriter const*) const;
template uint32_t StructWithRefTypeSharedConst::serializedSizeZC<>(apache::thrift::BinaryProtocolWriter const*) const;
template void StructWithRefTypeSharedConst::readNoXfer<>(apache::thrift::CompactProtocolReader*);
template uint32_t StructWithRefTypeSharedConst::write<>(apache::thrift::CompactProtocolWriter*) const;
template uint32_t StructWithRefTypeSharedConst::serializedSize<>(apache::thrift::CompactProtocolWriter const*) const;
template uint32_t StructWithRefTypeSharedConst::serializedSizeZC<>(apache::thrift::CompactProtocolWriter const*) const;

static_assert(
    ::apache::thrift::detail::st::gen_check_json<
        StructWithRefTypeSharedConst,
        ::apache::thrift::type_class::structure,
        ::cpp2::Empty>,
    "inconsistent use of json option");
static_assert(
    ::apache::thrift::detail::st::gen_check_json<
        StructWithRefTypeSharedConst,
        ::apache::thrift::type_class::structure,
        ::cpp2::Empty>,
    "inconsistent use of json option");
static_assert(
    ::apache::thrift::detail::st::gen_check_json<
        StructWithRefTypeSharedConst,
        ::apache::thrift::type_class::structure,
        ::cpp2::Empty>,
    "inconsistent use of json option");

} // cpp2

namespace apache {
namespace thrift {
namespace detail {

void TccStructTraits<::cpp2::StructWithRefAndAnnotCppNoexceptMoveCtor>::translateFieldName(
    folly::StringPiece _fname,
    int16_t& fid,
    apache::thrift::protocol::TType& _ftype) noexcept {
  using data = apache::thrift::TStructDataStorage<::cpp2::StructWithRefAndAnnotCppNoexceptMoveCtor>;
  static const st::translate_field_name_table table{
      data::fields_size,
      data::fields_names.data(),
      data::fields_ids.data(),
      data::fields_types.data()};
  st::translate_field_name(_fname, fid, _ftype, table);
}

} // namespace detail
} // namespace thrift
} // namespace apache

namespace cpp2 {

const folly::StringPiece StructWithRefAndAnnotCppNoexceptMoveCtor::__fbthrift_get_field_name(::apache::thrift::FieldOrdinal ord) {
  if (ord == ::apache::thrift::FieldOrdinal{0}) { return {}; }
  return apache::thrift::TStructDataStorage<StructWithRefAndAnnotCppNoexceptMoveCtor>::fields_names[folly::to_underlying(ord) - 1];
}

StructWithRefAndAnnotCppNoexceptMoveCtor::StructWithRefAndAnnotCppNoexceptMoveCtor(const StructWithRefAndAnnotCppNoexceptMoveCtor& srcObj) :
    __fbthrift_field_def_field(::apache::thrift::detail::st::copy_field<
          ::apache::thrift::type_class::structure>(srcObj.__fbthrift_field_def_field)) {
}

StructWithRefAndAnnotCppNoexceptMoveCtor& StructWithRefAndAnnotCppNoexceptMoveCtor::operator=(const StructWithRefAndAnnotCppNoexceptMoveCtor& other) {
  StructWithRefAndAnnotCppNoexceptMoveCtor tmp(other);
  swap(*this, tmp);
  return *this;
}

StructWithRefAndAnnotCppNoexceptMoveCtor::StructWithRefAndAnnotCppNoexceptMoveCtor(FOLLY_MAYBE_UNUSED StructWithRefAndAnnotCppNoexceptMoveCtor&& other) noexcept :
    __fbthrift_field_def_field(std::move(other.__fbthrift_field_def_field)) {
}

StructWithRefAndAnnotCppNoexceptMoveCtor& StructWithRefAndAnnotCppNoexceptMoveCtor::operator=(FOLLY_MAYBE_UNUSED StructWithRefAndAnnotCppNoexceptMoveCtor&& other) noexcept {
    this->__fbthrift_field_def_field = std::move(other.__fbthrift_field_def_field);
    return *this;
}

StructWithRefAndAnnotCppNoexceptMoveCtor::StructWithRefAndAnnotCppNoexceptMoveCtor(apache::thrift::FragileConstructor, ::std::unique_ptr<::cpp2::Empty> def_field__arg) :
    __fbthrift_field_def_field(std::move(def_field__arg)) {
}

void StructWithRefAndAnnotCppNoexceptMoveCtor::__fbthrift_clear() {
  // clear all fields
}

void StructWithRefAndAnnotCppNoexceptMoveCtor::__fbthrift_clear_terse_fields() {
}

bool StructWithRefAndAnnotCppNoexceptMoveCtor::__fbthrift_is_empty() const {
  return false;
}

bool StructWithRefAndAnnotCppNoexceptMoveCtor::operator==(FOLLY_MAYBE_UNUSED const StructWithRefAndAnnotCppNoexceptMoveCtor& rhs) const {
  FOLLY_MAYBE_UNUSED auto& lhs = *this;
  if ((!::apache::thrift::detail::pointer_equal(lhs.def_field_ref(), rhs.def_field_ref()))) {
    return false;
  }
  return true;
}

bool StructWithRefAndAnnotCppNoexceptMoveCtor::operator<(FOLLY_MAYBE_UNUSED const StructWithRefAndAnnotCppNoexceptMoveCtor& rhs) const {
  FOLLY_MAYBE_UNUSED auto& lhs = *this;
  if ((!::apache::thrift::detail::pointer_equal(lhs.def_field_ref(), rhs.def_field_ref()))) {
    return ::apache::thrift::detail::pointer_less(lhs.def_field_ref(), rhs.def_field_ref());
  }
  return false;
}

void swap(FOLLY_MAYBE_UNUSED StructWithRefAndAnnotCppNoexceptMoveCtor& a, FOLLY_MAYBE_UNUSED StructWithRefAndAnnotCppNoexceptMoveCtor& b) {
  using ::std::swap;
  swap(a.__fbthrift_field_def_field, b.__fbthrift_field_def_field);
}

template void StructWithRefAndAnnotCppNoexceptMoveCtor::readNoXfer<>(apache::thrift::BinaryProtocolReader*);
template uint32_t StructWithRefAndAnnotCppNoexceptMoveCtor::write<>(apache::thrift::BinaryProtocolWriter*) const;
template uint32_t StructWithRefAndAnnotCppNoexceptMoveCtor::serializedSize<>(apache::thrift::BinaryProtocolWriter const*) const;
template uint32_t StructWithRefAndAnnotCppNoexceptMoveCtor::serializedSizeZC<>(apache::thrift::BinaryProtocolWriter const*) const;
template void StructWithRefAndAnnotCppNoexceptMoveCtor::readNoXfer<>(apache::thrift::CompactProtocolReader*);
template uint32_t StructWithRefAndAnnotCppNoexceptMoveCtor::write<>(apache::thrift::CompactProtocolWriter*) const;
template uint32_t StructWithRefAndAnnotCppNoexceptMoveCtor::serializedSize<>(apache::thrift::CompactProtocolWriter const*) const;
template uint32_t StructWithRefAndAnnotCppNoexceptMoveCtor::serializedSizeZC<>(apache::thrift::CompactProtocolWriter const*) const;

static_assert(
    ::apache::thrift::detail::st::gen_check_json<
        StructWithRefAndAnnotCppNoexceptMoveCtor,
        ::apache::thrift::type_class::structure,
        ::cpp2::Empty>,
    "inconsistent use of json option");

} // cpp2

namespace apache {
namespace thrift {
namespace detail {

void TccStructTraits<::cpp2::StructWithString>::translateFieldName(
    folly::StringPiece _fname,
    int16_t& fid,
    apache::thrift::protocol::TType& _ftype) noexcept {
  using data = apache::thrift::TStructDataStorage<::cpp2::StructWithString>;
  static const st::translate_field_name_table table{
      data::fields_size,
      data::fields_names.data(),
      data::fields_ids.data(),
      data::fields_types.data()};
  st::translate_field_name(_fname, fid, _ftype, table);
}

} // namespace detail
} // namespace thrift
} // namespace apache

namespace cpp2 {

const folly::StringPiece StructWithString::__fbthrift_get_field_name(::apache::thrift::FieldOrdinal ord) {
  if (ord == ::apache::thrift::FieldOrdinal{0}) { return {}; }
  return apache::thrift::TStructDataStorage<StructWithString>::fields_names[folly::to_underlying(ord) - 1];
}

StructWithString::StructWithString(const StructWithString& srcObj) :
    __fbthrift_field_def_unique_string_ref(::apache::thrift::detail::st::copy_field<
          ::apache::thrift::type_class::string>(srcObj.__fbthrift_field_def_unique_string_ref)),
    __fbthrift_field_def_shared_string_ref(srcObj.__fbthrift_field_def_shared_string_ref),
    __fbthrift_field_def_shared_string_const_ref(srcObj.__fbthrift_field_def_shared_string_const_ref),
    __fbthrift_field_unique_string_ref(::apache::thrift::detail::st::copy_field<
          ::apache::thrift::type_class::string>(srcObj.__fbthrift_field_unique_string_ref)),
    __fbthrift_field_shared_string_ref(srcObj.__fbthrift_field_shared_string_ref) {
}

StructWithString& StructWithString::operator=(const StructWithString& other) {
  StructWithString tmp(other);
  swap(*this, tmp);
  return *this;
}

StructWithString::StructWithString() :
      __fbthrift_field_def_unique_string_ref(std::make_unique<::std::string>(apache::thrift::StringTraits<std::string>::fromStringLiteral("..."))),
      __fbthrift_field_def_shared_string_ref(std::make_shared<::std::string>(apache::thrift::StringTraits<std::string>::fromStringLiteral("..."))),
      __fbthrift_field_def_shared_string_const_ref(std::make_shared<::std::string>(apache::thrift::StringTraits<std::string>::fromStringLiteral("..."))),
      __fbthrift_field_unique_string_ref(std::make_unique<::std::string>()),
      __fbthrift_field_shared_string_ref(std::make_shared<::std::string>()) {
}

StructWithString::~StructWithString() {}

StructWithString::StructWithString(FOLLY_MAYBE_UNUSED StructWithString&& other) noexcept :
    __fbthrift_field_def_unique_string_ref(std::move(other.__fbthrift_field_def_unique_string_ref)),
    __fbthrift_field_def_shared_string_ref(std::move(other.__fbthrift_field_def_shared_string_ref)),
    __fbthrift_field_def_shared_string_const_ref(std::move(other.__fbthrift_field_def_shared_string_const_ref)),
    __fbthrift_field_unique_string_ref(std::move(other.__fbthrift_field_unique_string_ref)),
    __fbthrift_field_shared_string_ref(std::move(other.__fbthrift_field_shared_string_ref)) {
}

StructWithString& StructWithString::operator=(FOLLY_MAYBE_UNUSED StructWithString&& other) noexcept {
    this->__fbthrift_field_def_unique_string_ref = std::move(other.__fbthrift_field_def_unique_string_ref);
    this->__fbthrift_field_def_shared_string_ref = std::move(other.__fbthrift_field_def_shared_string_ref);
    this->__fbthrift_field_def_shared_string_const_ref = std::move(other.__fbthrift_field_def_shared_string_const_ref);
    this->__fbthrift_field_unique_string_ref = std::move(other.__fbthrift_field_unique_string_ref);
    this->__fbthrift_field_shared_string_ref = std::move(other.__fbthrift_field_shared_string_ref);
    return *this;
}

StructWithString::StructWithString(apache::thrift::FragileConstructor, ::std::unique_ptr<::std::string> def_unique_string_ref__arg, ::std::shared_ptr<::std::string> def_shared_string_ref__arg, ::std::shared_ptr<const ::std::string> def_shared_string_const_ref__arg, ::std::unique_ptr<::std::string> unique_string_ref__arg, ::std::shared_ptr<::std::string> shared_string_ref__arg) :
    __fbthrift_field_def_unique_string_ref(std::move(def_unique_string_ref__arg)),
    __fbthrift_field_def_shared_string_ref(std::move(def_shared_string_ref__arg)),
    __fbthrift_field_def_shared_string_const_ref(std::move(def_shared_string_const_ref__arg)),
    __fbthrift_field_unique_string_ref(std::move(unique_string_ref__arg)),
    __fbthrift_field_shared_string_ref(std::move(shared_string_ref__arg)) {
}

void StructWithString::__fbthrift_clear() {
  // clear all fields
  this->__fbthrift_field_def_unique_string_ref = ::apache::thrift::detail::make_mutable_smart_ptr<::std::unique_ptr<::std::string>>();
  this->__fbthrift_field_def_shared_string_ref = ::apache::thrift::detail::make_mutable_smart_ptr<::std::shared_ptr<::std::string>>();
  this->__fbthrift_field_def_shared_string_const_ref = ::apache::thrift::detail::make_mutable_smart_ptr<::std::shared_ptr<const ::std::string>>();
  this->__fbthrift_field_unique_string_ref = ::apache::thrift::detail::make_mutable_smart_ptr<::std::unique_ptr<::std::string>>();
  this->__fbthrift_field_shared_string_ref = ::apache::thrift::detail::make_mutable_smart_ptr<::std::shared_ptr<::std::string>>();
}

void StructWithString::__fbthrift_clear_terse_fields() {
}

bool StructWithString::__fbthrift_is_empty() const {
  return false;
}

bool StructWithString::operator==(FOLLY_MAYBE_UNUSED const StructWithString& rhs) const {
  FOLLY_MAYBE_UNUSED auto& lhs = *this;
  if ((!::apache::thrift::detail::pointer_equal(lhs.def_unique_string_ref_ref(), rhs.def_unique_string_ref_ref()))) {
    return false;
  }
  if ((!::apache::thrift::detail::pointer_equal(lhs.def_shared_string_ref_ref(), rhs.def_shared_string_ref_ref()))) {
    return false;
  }
  if ((!::apache::thrift::detail::pointer_equal(lhs.def_shared_string_const_ref_ref(), rhs.def_shared_string_const_ref_ref()))) {
    return false;
  }
  if ((!::apache::thrift::detail::pointer_equal(lhs.unique_string_ref_ref(), rhs.unique_string_ref_ref()))) {
    return false;
  }
  if ((!::apache::thrift::detail::pointer_equal(lhs.shared_string_ref_ref(), rhs.shared_string_ref_ref()))) {
    return false;
  }
  return true;
}

bool StructWithString::operator<(FOLLY_MAYBE_UNUSED const StructWithString& rhs) const {
  FOLLY_MAYBE_UNUSED auto& lhs = *this;
  if ((!::apache::thrift::detail::pointer_equal(lhs.def_unique_string_ref_ref(), rhs.def_unique_string_ref_ref()))) {
    return ::apache::thrift::detail::pointer_less(lhs.def_unique_string_ref_ref(), rhs.def_unique_string_ref_ref());
  }
  if ((!::apache::thrift::detail::pointer_equal(lhs.def_shared_string_ref_ref(), rhs.def_shared_string_ref_ref()))) {
    return ::apache::thrift::detail::pointer_less(lhs.def_shared_string_ref_ref(), rhs.def_shared_string_ref_ref());
  }
  if ((!::apache::thrift::detail::pointer_equal(lhs.def_shared_string_const_ref_ref(), rhs.def_shared_string_const_ref_ref()))) {
    return ::apache::thrift::detail::pointer_less(lhs.def_shared_string_const_ref_ref(), rhs.def_shared_string_const_ref_ref());
  }
  if ((!::apache::thrift::detail::pointer_equal(lhs.unique_string_ref_ref(), rhs.unique_string_ref_ref()))) {
    return ::apache::thrift::detail::pointer_less(lhs.unique_string_ref_ref(), rhs.unique_string_ref_ref());
  }
  if ((!::apache::thrift::detail::pointer_equal(lhs.shared_string_ref_ref(), rhs.shared_string_ref_ref()))) {
    return ::apache::thrift::detail::pointer_less(lhs.shared_string_ref_ref(), rhs.shared_string_ref_ref());
  }
  return false;
}

void swap(FOLLY_MAYBE_UNUSED StructWithString& a, FOLLY_MAYBE_UNUSED StructWithString& b) {
  using ::std::swap;
  swap(a.__fbthrift_field_def_unique_string_ref, b.__fbthrift_field_def_unique_string_ref);
  swap(a.__fbthrift_field_def_shared_string_ref, b.__fbthrift_field_def_shared_string_ref);
  swap(a.__fbthrift_field_def_shared_string_const_ref, b.__fbthrift_field_def_shared_string_const_ref);
  swap(a.__fbthrift_field_unique_string_ref, b.__fbthrift_field_unique_string_ref);
  swap(a.__fbthrift_field_shared_string_ref, b.__fbthrift_field_shared_string_ref);
}

template void StructWithString::readNoXfer<>(apache::thrift::BinaryProtocolReader*);
template uint32_t StructWithString::write<>(apache::thrift::BinaryProtocolWriter*) const;
template uint32_t StructWithString::serializedSize<>(apache::thrift::BinaryProtocolWriter const*) const;
template uint32_t StructWithString::serializedSizeZC<>(apache::thrift::BinaryProtocolWriter const*) const;
template void StructWithString::readNoXfer<>(apache::thrift::CompactProtocolReader*);
template uint32_t StructWithString::write<>(apache::thrift::CompactProtocolWriter*) const;
template uint32_t StructWithString::serializedSize<>(apache::thrift::CompactProtocolWriter const*) const;
template uint32_t StructWithString::serializedSizeZC<>(apache::thrift::CompactProtocolWriter const*) const;

} // cpp2

namespace cpp2 { namespace {
FOLLY_MAYBE_UNUSED FOLLY_ERASE void validateAdapters() {
  ::apache::thrift::adapt_detail::validateFieldAdapter<::my::Adapter1, 1, ::cpp2::Empty, ::cpp2::AdaptedStructWithInternBox>();
  ::apache::thrift::adapt_detail::validateFieldAdapter<::my::Adapter1, 2, ::cpp2::MyField, ::cpp2::AdaptedStructWithInternBox>();
  ::apache::thrift::adapt_detail::validateFieldAdapter<::my::Adapter1, 3, ::cpp2::Empty, ::cpp2::AdaptedStructWithInternBox>();
  ::apache::thrift::adapt_detail::validateFieldAdapter<::my::Adapter1, 4, ::cpp2::MyField, ::cpp2::AdaptedStructWithInternBox>();
}
}} // cpp2