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

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

#include "thrift/compiler/test/fixtures/terse_write/gen-cpp2/terse_write_data.h"
[[maybe_unused]] static constexpr std::string_view kModuleName = "terse_write";


namespace apache { namespace thrift {

const std::string_view TEnumTraits<::facebook::thrift::test::terse_write::MyEnum>::__fbthrift_module_name_internal_do_not_use = kModuleName;
folly::Range<::facebook::thrift::test::terse_write::MyEnum const*> const TEnumTraits<::facebook::thrift::test::terse_write::MyEnum>::values = folly::range(TEnumDataStorage<::facebook::thrift::test::terse_write::MyEnum>::values);
folly::Range<std::string_view const*> const TEnumTraits<::facebook::thrift::test::terse_write::MyEnum>::names = folly::range(TEnumDataStorage<::facebook::thrift::test::terse_write::MyEnum>::names);

bool TEnumTraits<::facebook::thrift::test::terse_write::MyEnum>::findName(type value, std::string_view* out) noexcept {
  return ::apache::thrift::detail::st::enum_find_name(value, out);
}

bool TEnumTraits<::facebook::thrift::test::terse_write::MyEnum>::findValue(std::string_view name, type* out) noexcept {
  return ::apache::thrift::detail::st::enum_find_value(name, out);
}

}} // apache::thrift


namespace apache {
namespace thrift {
namespace detail {

void TccStructTraits<::facebook::thrift::test::terse_write::MyStruct>::translateFieldName(
    std::string_view _fname,
    int16_t& fid,
    apache::thrift::protocol::TType& _ftype) noexcept {
  using data = apache::thrift::TStructDataStorage<::facebook::thrift::test::terse_write::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 facebook::thrift::test::terse_write {

const char* MyStruct::__fbthrift_thrift_uri() {
  return "facebook.com/thrift/test/terse_write/MyStruct";
}

std::string_view 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];
}
std::string_view MyStruct::__fbthrift_get_class_name() {
  return apache::thrift::TStructDataStorage<MyStruct>::name;
}


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


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

void MyStruct::__fbthrift_clear_terse_fields() {
}

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

bool MyStruct::operator==([[maybe_unused]] const MyStruct& rhs) const {
  return ::apache::thrift::op::detail::StructEquality{}(*this, rhs);
}

bool MyStruct::operator<([[maybe_unused]] const MyStruct& rhs) const {
  return ::apache::thrift::op::detail::StructLessThan{}(*this, rhs);
}


void swap([[maybe_unused]] MyStruct& a, [[maybe_unused]] MyStruct& b) {
  using ::std::swap;
}

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;


} // namespace facebook::thrift::test::terse_write

namespace apache {
namespace thrift {
namespace detail {

void TccStructTraits<::facebook::thrift::test::terse_write::MyUnion>::translateFieldName(
    std::string_view _fname,
    int16_t& fid,
    apache::thrift::protocol::TType& _ftype) noexcept {
  using data = apache::thrift::TStructDataStorage<::facebook::thrift::test::terse_write::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 {

folly::Range<::facebook::thrift::test::terse_write::MyUnion::Type const*> const TEnumTraits<::facebook::thrift::test::terse_write::MyUnion::Type>::values = folly::range(TEnumDataStorage<::facebook::thrift::test::terse_write::MyUnion::Type>::values);
folly::Range<std::string_view const*> const TEnumTraits<::facebook::thrift::test::terse_write::MyUnion::Type>::names = folly::range(TEnumDataStorage<::facebook::thrift::test::terse_write::MyUnion::Type>::names);

bool TEnumTraits<::facebook::thrift::test::terse_write::MyUnion::Type>::findName(type value, std::string_view* out) noexcept {
  return ::apache::thrift::detail::st::enum_find_name(value, out);
}

bool TEnumTraits<::facebook::thrift::test::terse_write::MyUnion::Type>::findValue(std::string_view name, type* out) noexcept {
  return ::apache::thrift::detail::st::enum_find_value(name, out);
}
}} // apache::thrift
namespace facebook::thrift::test::terse_write {

const char* MyUnion::__fbthrift_thrift_uri() {
  return "facebook.com/thrift/test/terse_write/MyUnion";
}

std::string_view 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];
}
std::string_view MyUnion::__fbthrift_get_class_name() {
  return apache::thrift::TStructDataStorage<MyUnion>::name;
}

void MyUnion::__fbthrift_destruct() {
  switch(getType()) {
    case Type::__EMPTY__:
      break;
    case Type::bool_field:
      ::std::destroy_at(::std::addressof(value_.bool_field));
      break;
    case Type::byte_field:
      ::std::destroy_at(::std::addressof(value_.byte_field));
      break;
    case Type::short_field:
      ::std::destroy_at(::std::addressof(value_.short_field));
      break;
    case Type::int_field:
      ::std::destroy_at(::std::addressof(value_.int_field));
      break;
    case Type::long_field:
      ::std::destroy_at(::std::addressof(value_.long_field));
      break;
    case Type::float_field:
      ::std::destroy_at(::std::addressof(value_.float_field));
      break;
    case Type::double_field:
      ::std::destroy_at(::std::addressof(value_.double_field));
      break;
    case Type::string_field:
      ::std::destroy_at(::std::addressof(value_.string_field));
      break;
    case Type::binary_field:
      ::std::destroy_at(::std::addressof(value_.binary_field));
      break;
    case Type::enum_field:
      ::std::destroy_at(::std::addressof(value_.enum_field));
      break;
    case Type::list_field:
      ::std::destroy_at(::std::addressof(value_.list_field));
      break;
    case Type::set_field:
      ::std::destroy_at(::std::addressof(value_.set_field));
      break;
    case Type::map_field:
      ::std::destroy_at(::std::addressof(value_.map_field));
      break;
    case Type::struct_field:
      ::std::destroy_at(::std::addressof(value_.struct_field));
      break;
    default:
      assert(false);
      break;
  }
}

void MyUnion::__fbthrift_clear() {
  __fbthrift_destruct();
  type_ = folly::to_underlying(Type::__EMPTY__);
}

  MyUnion::~MyUnion() {
    __fbthrift_destruct();
  }

bool MyUnion::__fbthrift_is_empty() const {
  return getType() == Type::__EMPTY__;
}
  MyUnion::MyUnion(const MyUnion& rhs)
      : type_(folly::to_underlying(Type::__EMPTY__)) {
    switch (rhs.getType()) {
      case Type::__EMPTY__:
        return;
      case Type::bool_field:
        set_bool_field(rhs.value_.bool_field);
        break;
      case Type::byte_field:
        set_byte_field(rhs.value_.byte_field);
        break;
      case Type::short_field:
        set_short_field(rhs.value_.short_field);
        break;
      case Type::int_field:
        set_int_field(rhs.value_.int_field);
        break;
      case Type::long_field:
        set_long_field(rhs.value_.long_field);
        break;
      case Type::float_field:
        set_float_field(rhs.value_.float_field);
        break;
      case Type::double_field:
        set_double_field(rhs.value_.double_field);
        break;
      case Type::string_field:
        set_string_field(rhs.value_.string_field);
        break;
      case Type::binary_field:
        set_binary_field(rhs.value_.binary_field);
        break;
      case Type::enum_field:
        set_enum_field(rhs.value_.enum_field);
        break;
      case Type::list_field:
        set_list_field(rhs.value_.list_field);
        break;
      case Type::set_field:
        set_set_field(rhs.value_.set_field);
        break;
      case Type::map_field:
        set_map_field(rhs.value_.map_field);
        break;
      case Type::struct_field:
        set_struct_field(rhs.value_.struct_field);
        break;
      default:
        assert(false);
    }
  }

    MyUnion&MyUnion::operator=(const MyUnion& rhs) {
    if (this == &rhs) { return *this; }
    switch (rhs.getType()) {
      case Type::__EMPTY__:
        __fbthrift_clear();
        return *this;
      case Type::bool_field:
        set_bool_field(rhs.value_.bool_field);
        break;
      case Type::byte_field:
        set_byte_field(rhs.value_.byte_field);
        break;
      case Type::short_field:
        set_short_field(rhs.value_.short_field);
        break;
      case Type::int_field:
        set_int_field(rhs.value_.int_field);
        break;
      case Type::long_field:
        set_long_field(rhs.value_.long_field);
        break;
      case Type::float_field:
        set_float_field(rhs.value_.float_field);
        break;
      case Type::double_field:
        set_double_field(rhs.value_.double_field);
        break;
      case Type::string_field:
        set_string_field(rhs.value_.string_field);
        break;
      case Type::binary_field:
        set_binary_field(rhs.value_.binary_field);
        break;
      case Type::enum_field:
        set_enum_field(rhs.value_.enum_field);
        break;
      case Type::list_field:
        set_list_field(rhs.value_.list_field);
        break;
      case Type::set_field:
        set_set_field(rhs.value_.set_field);
        break;
      case Type::map_field:
        set_map_field(rhs.value_.map_field);
        break;
      case Type::struct_field:
        set_struct_field(rhs.value_.struct_field);
        break;
      default:
        __fbthrift_clear();
        assert(false);
    }
    return *this;
  }


bool MyUnion::operator==(const MyUnion& rhs) const {
  return ::apache::thrift::op::detail::UnionEquality{}(*this, rhs);
}

bool MyUnion::operator<([[maybe_unused]] const MyUnion& rhs) const {
  return ::apache::thrift::op::detail::UnionLessThan{}(*this, rhs);
}

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;

static_assert(
    ::apache::thrift::detail::st::gen_check_json<
        MyUnion,
        ::apache::thrift::type_class::structure,
        ::facebook::thrift::test::terse_write::MyStruct>,
    "inconsistent use of json option");

} // namespace facebook::thrift::test::terse_write

namespace apache {
namespace thrift {
namespace detail {

void TccStructTraits<::facebook::thrift::test::terse_write::MyStructWithCustomDefault>::translateFieldName(
    std::string_view _fname,
    int16_t& fid,
    apache::thrift::protocol::TType& _ftype) noexcept {
  using data = apache::thrift::TStructDataStorage<::facebook::thrift::test::terse_write::MyStructWithCustomDefault>;
  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 facebook::thrift::test::terse_write {

const char* MyStructWithCustomDefault::__fbthrift_thrift_uri() {
  return "facebook.com/thrift/test/terse_write/MyStructWithCustomDefault";
}

std::string_view MyStructWithCustomDefault::__fbthrift_get_field_name(::apache::thrift::FieldOrdinal ord) {
  if (ord == ::apache::thrift::FieldOrdinal{0}) { return {}; }
  return apache::thrift::TStructDataStorage<MyStructWithCustomDefault>::fields_names[folly::to_underlying(ord) - 1];
}
std::string_view MyStructWithCustomDefault::__fbthrift_get_class_name() {
  return apache::thrift::TStructDataStorage<MyStructWithCustomDefault>::name;
}


MyStructWithCustomDefault::MyStructWithCustomDefault(apache::thrift::FragileConstructor, ::std::int64_t field1__arg) :
    __fbthrift_field_field1(std::move(field1__arg)) { 
  __isset.set(folly::index_constant<0>(), true);
}


void MyStructWithCustomDefault::__fbthrift_clear() {
  // clear all fields
  this->__fbthrift_field_field1 = ::std::int64_t();
  __isset = {};
}

void MyStructWithCustomDefault::__fbthrift_clear_terse_fields() {
}

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

bool MyStructWithCustomDefault::operator==([[maybe_unused]] const MyStructWithCustomDefault& rhs) const {
  return ::apache::thrift::op::detail::StructEquality{}(*this, rhs);
}

bool MyStructWithCustomDefault::operator<([[maybe_unused]] const MyStructWithCustomDefault& rhs) const {
  return ::apache::thrift::op::detail::StructLessThan{}(*this, rhs);
}


void swap([[maybe_unused]] MyStructWithCustomDefault& a, [[maybe_unused]] MyStructWithCustomDefault& b) {
  using ::std::swap;
  swap(a.__fbthrift_field_field1, b.__fbthrift_field_field1);
  swap(a.__isset, b.__isset);
}

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


} // namespace facebook::thrift::test::terse_write

namespace apache {
namespace thrift {
namespace detail {

void TccStructTraits<::facebook::thrift::test::terse_write::StructLevelTerseStruct>::translateFieldName(
    std::string_view _fname,
    int16_t& fid,
    apache::thrift::protocol::TType& _ftype) noexcept {
  using data = apache::thrift::TStructDataStorage<::facebook::thrift::test::terse_write::StructLevelTerseStruct>;
  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 facebook::thrift::test::terse_write {

const char* StructLevelTerseStruct::__fbthrift_thrift_uri() {
  return "facebook.com/thrift/test/terse_write/StructLevelTerseStruct";
}

std::string_view StructLevelTerseStruct::__fbthrift_get_field_name(::apache::thrift::FieldOrdinal ord) {
  if (ord == ::apache::thrift::FieldOrdinal{0}) { return {}; }
  return apache::thrift::TStructDataStorage<StructLevelTerseStruct>::fields_names[folly::to_underlying(ord) - 1];
}
std::string_view StructLevelTerseStruct::__fbthrift_get_class_name() {
  return apache::thrift::TStructDataStorage<StructLevelTerseStruct>::name;
}

StructLevelTerseStruct::StructLevelTerseStruct(const StructLevelTerseStruct&) = default;
StructLevelTerseStruct& StructLevelTerseStruct::operator=(const StructLevelTerseStruct&) = default;
StructLevelTerseStruct::StructLevelTerseStruct() :
    __fbthrift_field_bool_field(),
    __fbthrift_field_byte_field(),
    __fbthrift_field_short_field(),
    __fbthrift_field_int_field(),
    __fbthrift_field_long_field(),
    __fbthrift_field_float_field(),
    __fbthrift_field_double_field(),
    __fbthrift_field_enum_field() {
}


StructLevelTerseStruct::~StructLevelTerseStruct() {}

StructLevelTerseStruct::StructLevelTerseStruct([[maybe_unused]] StructLevelTerseStruct&& other) noexcept :
    __fbthrift_field_bool_field(std::move(other.__fbthrift_field_bool_field)),
    __fbthrift_field_byte_field(std::move(other.__fbthrift_field_byte_field)),
    __fbthrift_field_short_field(std::move(other.__fbthrift_field_short_field)),
    __fbthrift_field_int_field(std::move(other.__fbthrift_field_int_field)),
    __fbthrift_field_long_field(std::move(other.__fbthrift_field_long_field)),
    __fbthrift_field_float_field(std::move(other.__fbthrift_field_float_field)),
    __fbthrift_field_double_field(std::move(other.__fbthrift_field_double_field)),
    __fbthrift_field_string_field(std::move(other.__fbthrift_field_string_field)),
    __fbthrift_field_binary_field(std::move(other.__fbthrift_field_binary_field)),
    __fbthrift_field_enum_field(std::move(other.__fbthrift_field_enum_field)),
    __fbthrift_field_list_field(std::move(other.__fbthrift_field_list_field)),
    __fbthrift_field_set_field(std::move(other.__fbthrift_field_set_field)),
    __fbthrift_field_map_field(std::move(other.__fbthrift_field_map_field)),
    __fbthrift_field_struct_field(std::move(other.__fbthrift_field_struct_field)),
    __fbthrift_field_union_field(std::move(other.__fbthrift_field_union_field)) {
}

StructLevelTerseStruct& StructLevelTerseStruct::operator=([[maybe_unused]] StructLevelTerseStruct&& other) noexcept {
    this->__fbthrift_field_bool_field = std::move(other.__fbthrift_field_bool_field);
    this->__fbthrift_field_byte_field = std::move(other.__fbthrift_field_byte_field);
    this->__fbthrift_field_short_field = std::move(other.__fbthrift_field_short_field);
    this->__fbthrift_field_int_field = std::move(other.__fbthrift_field_int_field);
    this->__fbthrift_field_long_field = std::move(other.__fbthrift_field_long_field);
    this->__fbthrift_field_float_field = std::move(other.__fbthrift_field_float_field);
    this->__fbthrift_field_double_field = std::move(other.__fbthrift_field_double_field);
    this->__fbthrift_field_string_field = std::move(other.__fbthrift_field_string_field);
    this->__fbthrift_field_binary_field = std::move(other.__fbthrift_field_binary_field);
    this->__fbthrift_field_enum_field = std::move(other.__fbthrift_field_enum_field);
    this->__fbthrift_field_list_field = std::move(other.__fbthrift_field_list_field);
    this->__fbthrift_field_set_field = std::move(other.__fbthrift_field_set_field);
    this->__fbthrift_field_map_field = std::move(other.__fbthrift_field_map_field);
    this->__fbthrift_field_struct_field = std::move(other.__fbthrift_field_struct_field);
    this->__fbthrift_field_union_field = std::move(other.__fbthrift_field_union_field);
    return *this;
}


StructLevelTerseStruct::StructLevelTerseStruct(apache::thrift::FragileConstructor, bool bool_field__arg, ::std::int8_t byte_field__arg, ::std::int16_t short_field__arg, ::std::int32_t int_field__arg, ::std::int64_t long_field__arg, float float_field__arg, double double_field__arg, ::std::string string_field__arg, ::std::string binary_field__arg, ::facebook::thrift::test::terse_write::MyEnum enum_field__arg, ::std::vector<::std::int16_t> list_field__arg, ::std::set<::std::int16_t> set_field__arg, ::std::map<::std::int16_t, ::std::int16_t> map_field__arg, ::facebook::thrift::test::terse_write::MyStruct struct_field__arg, ::facebook::thrift::test::terse_write::MyUnion union_field__arg) :
    __fbthrift_field_bool_field(std::move(bool_field__arg)),
    __fbthrift_field_byte_field(std::move(byte_field__arg)),
    __fbthrift_field_short_field(std::move(short_field__arg)),
    __fbthrift_field_int_field(std::move(int_field__arg)),
    __fbthrift_field_long_field(std::move(long_field__arg)),
    __fbthrift_field_float_field(std::move(float_field__arg)),
    __fbthrift_field_double_field(std::move(double_field__arg)),
    __fbthrift_field_string_field(std::move(string_field__arg)),
    __fbthrift_field_binary_field(std::move(binary_field__arg)),
    __fbthrift_field_enum_field(std::move(enum_field__arg)),
    __fbthrift_field_list_field(std::move(list_field__arg)),
    __fbthrift_field_set_field(std::move(set_field__arg)),
    __fbthrift_field_map_field(std::move(map_field__arg)),
    __fbthrift_field_struct_field(std::move(struct_field__arg)),
    __fbthrift_field_union_field(std::move(union_field__arg)) { 
}


void StructLevelTerseStruct::__fbthrift_clear() {
  // clear all fields
  this->__fbthrift_field_bool_field = bool();
  this->__fbthrift_field_byte_field = ::std::int8_t();
  this->__fbthrift_field_short_field = ::std::int16_t();
  this->__fbthrift_field_int_field = ::std::int32_t();
  this->__fbthrift_field_long_field = ::std::int64_t();
  this->__fbthrift_field_float_field = float();
  this->__fbthrift_field_double_field = double();
  this->__fbthrift_field_string_field = apache::thrift::StringTraits<std::string>::fromStringLiteral("");
  this->__fbthrift_field_binary_field = apache::thrift::StringTraits<std::string>::fromStringLiteral("");
  this->__fbthrift_field_enum_field = ::facebook::thrift::test::terse_write::MyEnum();
  this->__fbthrift_field_list_field.clear();
  this->__fbthrift_field_set_field.clear();
  this->__fbthrift_field_map_field.clear();
  ::apache::thrift::clear(this->__fbthrift_field_union_field);
}

void StructLevelTerseStruct::__fbthrift_clear_terse_fields() {
  this->__fbthrift_field_bool_field = bool();
  this->__fbthrift_field_byte_field = ::std::int8_t();
  this->__fbthrift_field_short_field = ::std::int16_t();
  this->__fbthrift_field_int_field = ::std::int32_t();
  this->__fbthrift_field_long_field = ::std::int64_t();
  this->__fbthrift_field_float_field = float();
  this->__fbthrift_field_double_field = double();
  this->__fbthrift_field_string_field = apache::thrift::StringTraits<std::string>::fromStringLiteral("");
  this->__fbthrift_field_binary_field = apache::thrift::StringTraits<std::string>::fromStringLiteral("");
  this->__fbthrift_field_enum_field = ::facebook::thrift::test::terse_write::MyEnum();
  this->__fbthrift_field_list_field.clear();
  this->__fbthrift_field_set_field.clear();
  this->__fbthrift_field_map_field.clear();
  ::apache::thrift::clear(this->__fbthrift_field_union_field);
}

bool StructLevelTerseStruct::__fbthrift_is_empty() const {
  return ::apache::thrift::op::isEmpty<::apache::thrift::type::bool_t>(this->__fbthrift_field_bool_field) &&
 ::apache::thrift::op::isEmpty<::apache::thrift::type::byte_t>(this->__fbthrift_field_byte_field) &&
 ::apache::thrift::op::isEmpty<::apache::thrift::type::i16_t>(this->__fbthrift_field_short_field) &&
 ::apache::thrift::op::isEmpty<::apache::thrift::type::i32_t>(this->__fbthrift_field_int_field) &&
 ::apache::thrift::op::isEmpty<::apache::thrift::type::i64_t>(this->__fbthrift_field_long_field) &&
 ::apache::thrift::op::isEmpty<::apache::thrift::type::float_t>(this->__fbthrift_field_float_field) &&
 ::apache::thrift::op::isEmpty<::apache::thrift::type::double_t>(this->__fbthrift_field_double_field) &&
 ::apache::thrift::op::isEmpty<::apache::thrift::type::string_t>(this->__fbthrift_field_string_field) &&
 ::apache::thrift::op::isEmpty<::apache::thrift::type::binary_t>(this->__fbthrift_field_binary_field) &&
 ::apache::thrift::op::isEmpty<::apache::thrift::type::enum_t<::facebook::thrift::test::terse_write::MyEnum>>(this->__fbthrift_field_enum_field) &&
 ::apache::thrift::op::isEmpty<::apache::thrift::type::list<::apache::thrift::type::i16_t>>(this->__fbthrift_field_list_field) &&
 ::apache::thrift::op::isEmpty<::apache::thrift::type::set<::apache::thrift::type::i16_t>>(this->__fbthrift_field_set_field) &&
 ::apache::thrift::op::isEmpty<::apache::thrift::type::map<::apache::thrift::type::i16_t, ::apache::thrift::type::i16_t>>(this->__fbthrift_field_map_field) &&
 ::apache::thrift::op::isEmpty<::apache::thrift::type::struct_t<::facebook::thrift::test::terse_write::MyStruct>>(this->__fbthrift_field_struct_field) &&
 ::apache::thrift::op::isEmpty<::apache::thrift::type::union_t<::facebook::thrift::test::terse_write::MyUnion>>(this->__fbthrift_field_union_field);
}

bool StructLevelTerseStruct::operator==([[maybe_unused]] const StructLevelTerseStruct& rhs) const {
  return ::apache::thrift::op::detail::StructEquality{}(*this, rhs);
}

bool StructLevelTerseStruct::operator<([[maybe_unused]] const StructLevelTerseStruct& rhs) const {
  return ::apache::thrift::op::detail::StructLessThan{}(*this, rhs);
}


void swap([[maybe_unused]] StructLevelTerseStruct& a, [[maybe_unused]] StructLevelTerseStruct& b) {
  using ::std::swap;
  swap(a.__fbthrift_field_bool_field, b.__fbthrift_field_bool_field);
  swap(a.__fbthrift_field_byte_field, b.__fbthrift_field_byte_field);
  swap(a.__fbthrift_field_short_field, b.__fbthrift_field_short_field);
  swap(a.__fbthrift_field_int_field, b.__fbthrift_field_int_field);
  swap(a.__fbthrift_field_long_field, b.__fbthrift_field_long_field);
  swap(a.__fbthrift_field_float_field, b.__fbthrift_field_float_field);
  swap(a.__fbthrift_field_double_field, b.__fbthrift_field_double_field);
  swap(a.__fbthrift_field_string_field, b.__fbthrift_field_string_field);
  swap(a.__fbthrift_field_binary_field, b.__fbthrift_field_binary_field);
  swap(a.__fbthrift_field_enum_field, b.__fbthrift_field_enum_field);
  swap(a.__fbthrift_field_list_field, b.__fbthrift_field_list_field);
  swap(a.__fbthrift_field_set_field, b.__fbthrift_field_set_field);
  swap(a.__fbthrift_field_map_field, b.__fbthrift_field_map_field);
  swap(a.__fbthrift_field_struct_field, b.__fbthrift_field_struct_field);
  swap(a.__fbthrift_field_union_field, b.__fbthrift_field_union_field);
}

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

static_assert(
    ::apache::thrift::detail::st::gen_check_json<
        StructLevelTerseStruct,
        ::apache::thrift::type_class::structure,
        ::facebook::thrift::test::terse_write::MyStruct>,
    "inconsistent use of json option");
static_assert(
    ::apache::thrift::detail::st::gen_check_json<
        StructLevelTerseStruct,
        ::apache::thrift::type_class::variant,
        ::facebook::thrift::test::terse_write::MyUnion>,
    "inconsistent use of json option");

} // namespace facebook::thrift::test::terse_write

namespace apache {
namespace thrift {
namespace detail {

void TccStructTraits<::facebook::thrift::test::terse_write::FieldLevelTerseStruct>::translateFieldName(
    std::string_view _fname,
    int16_t& fid,
    apache::thrift::protocol::TType& _ftype) noexcept {
  using data = apache::thrift::TStructDataStorage<::facebook::thrift::test::terse_write::FieldLevelTerseStruct>;
  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 facebook::thrift::test::terse_write {

const char* FieldLevelTerseStruct::__fbthrift_thrift_uri() {
  return "facebook.com/thrift/test/terse_write/FieldLevelTerseStruct";
}

std::string_view FieldLevelTerseStruct::__fbthrift_get_field_name(::apache::thrift::FieldOrdinal ord) {
  if (ord == ::apache::thrift::FieldOrdinal{0}) { return {}; }
  return apache::thrift::TStructDataStorage<FieldLevelTerseStruct>::fields_names[folly::to_underlying(ord) - 1];
}
std::string_view FieldLevelTerseStruct::__fbthrift_get_class_name() {
  return apache::thrift::TStructDataStorage<FieldLevelTerseStruct>::name;
}

FieldLevelTerseStruct::FieldLevelTerseStruct(const FieldLevelTerseStruct&) = default;
FieldLevelTerseStruct& FieldLevelTerseStruct::operator=(const FieldLevelTerseStruct&) = default;
FieldLevelTerseStruct::FieldLevelTerseStruct() :
    __fbthrift_field_terse_bool_field(),
    __fbthrift_field_terse_byte_field(),
    __fbthrift_field_terse_short_field(),
    __fbthrift_field_terse_int_field(),
    __fbthrift_field_terse_long_field(),
    __fbthrift_field_terse_float_field(),
    __fbthrift_field_terse_double_field(),
    __fbthrift_field_terse_enum_field(),
    __fbthrift_field_bool_field(),
    __fbthrift_field_byte_field(),
    __fbthrift_field_short_field(),
    __fbthrift_field_int_field(),
    __fbthrift_field_long_field(),
    __fbthrift_field_float_field(),
    __fbthrift_field_double_field(),
    __fbthrift_field_enum_field() {
}


FieldLevelTerseStruct::~FieldLevelTerseStruct() {}

FieldLevelTerseStruct::FieldLevelTerseStruct([[maybe_unused]] FieldLevelTerseStruct&& other) noexcept :
    __fbthrift_field_terse_bool_field(std::move(other.__fbthrift_field_terse_bool_field)),
    __fbthrift_field_terse_byte_field(std::move(other.__fbthrift_field_terse_byte_field)),
    __fbthrift_field_terse_short_field(std::move(other.__fbthrift_field_terse_short_field)),
    __fbthrift_field_terse_int_field(std::move(other.__fbthrift_field_terse_int_field)),
    __fbthrift_field_terse_long_field(std::move(other.__fbthrift_field_terse_long_field)),
    __fbthrift_field_terse_float_field(std::move(other.__fbthrift_field_terse_float_field)),
    __fbthrift_field_terse_double_field(std::move(other.__fbthrift_field_terse_double_field)),
    __fbthrift_field_terse_string_field(std::move(other.__fbthrift_field_terse_string_field)),
    __fbthrift_field_terse_binary_field(std::move(other.__fbthrift_field_terse_binary_field)),
    __fbthrift_field_terse_enum_field(std::move(other.__fbthrift_field_terse_enum_field)),
    __fbthrift_field_terse_list_field(std::move(other.__fbthrift_field_terse_list_field)),
    __fbthrift_field_terse_set_field(std::move(other.__fbthrift_field_terse_set_field)),
    __fbthrift_field_terse_map_field(std::move(other.__fbthrift_field_terse_map_field)),
    __fbthrift_field_terse_struct_field(std::move(other.__fbthrift_field_terse_struct_field)),
    __fbthrift_field_terse_union_field(std::move(other.__fbthrift_field_terse_union_field)),
    __fbthrift_field_bool_field(std::move(other.__fbthrift_field_bool_field)),
    __fbthrift_field_byte_field(std::move(other.__fbthrift_field_byte_field)),
    __fbthrift_field_short_field(std::move(other.__fbthrift_field_short_field)),
    __fbthrift_field_int_field(std::move(other.__fbthrift_field_int_field)),
    __fbthrift_field_long_field(std::move(other.__fbthrift_field_long_field)),
    __fbthrift_field_float_field(std::move(other.__fbthrift_field_float_field)),
    __fbthrift_field_double_field(std::move(other.__fbthrift_field_double_field)),
    __fbthrift_field_string_field(std::move(other.__fbthrift_field_string_field)),
    __fbthrift_field_binary_field(std::move(other.__fbthrift_field_binary_field)),
    __fbthrift_field_enum_field(std::move(other.__fbthrift_field_enum_field)),
    __fbthrift_field_list_field(std::move(other.__fbthrift_field_list_field)),
    __fbthrift_field_set_field(std::move(other.__fbthrift_field_set_field)),
    __fbthrift_field_map_field(std::move(other.__fbthrift_field_map_field)),
    __fbthrift_field_struct_field(std::move(other.__fbthrift_field_struct_field)),
    __fbthrift_field_union_field(std::move(other.__fbthrift_field_union_field)),
    __isset(other.__isset) {
}

FieldLevelTerseStruct& FieldLevelTerseStruct::operator=([[maybe_unused]] FieldLevelTerseStruct&& other) noexcept {
    this->__fbthrift_field_terse_bool_field = std::move(other.__fbthrift_field_terse_bool_field);
    this->__fbthrift_field_terse_byte_field = std::move(other.__fbthrift_field_terse_byte_field);
    this->__fbthrift_field_terse_short_field = std::move(other.__fbthrift_field_terse_short_field);
    this->__fbthrift_field_terse_int_field = std::move(other.__fbthrift_field_terse_int_field);
    this->__fbthrift_field_terse_long_field = std::move(other.__fbthrift_field_terse_long_field);
    this->__fbthrift_field_terse_float_field = std::move(other.__fbthrift_field_terse_float_field);
    this->__fbthrift_field_terse_double_field = std::move(other.__fbthrift_field_terse_double_field);
    this->__fbthrift_field_terse_string_field = std::move(other.__fbthrift_field_terse_string_field);
    this->__fbthrift_field_terse_binary_field = std::move(other.__fbthrift_field_terse_binary_field);
    this->__fbthrift_field_terse_enum_field = std::move(other.__fbthrift_field_terse_enum_field);
    this->__fbthrift_field_terse_list_field = std::move(other.__fbthrift_field_terse_list_field);
    this->__fbthrift_field_terse_set_field = std::move(other.__fbthrift_field_terse_set_field);
    this->__fbthrift_field_terse_map_field = std::move(other.__fbthrift_field_terse_map_field);
    this->__fbthrift_field_terse_struct_field = std::move(other.__fbthrift_field_terse_struct_field);
    this->__fbthrift_field_terse_union_field = std::move(other.__fbthrift_field_terse_union_field);
    this->__fbthrift_field_bool_field = std::move(other.__fbthrift_field_bool_field);
    this->__fbthrift_field_byte_field = std::move(other.__fbthrift_field_byte_field);
    this->__fbthrift_field_short_field = std::move(other.__fbthrift_field_short_field);
    this->__fbthrift_field_int_field = std::move(other.__fbthrift_field_int_field);
    this->__fbthrift_field_long_field = std::move(other.__fbthrift_field_long_field);
    this->__fbthrift_field_float_field = std::move(other.__fbthrift_field_float_field);
    this->__fbthrift_field_double_field = std::move(other.__fbthrift_field_double_field);
    this->__fbthrift_field_string_field = std::move(other.__fbthrift_field_string_field);
    this->__fbthrift_field_binary_field = std::move(other.__fbthrift_field_binary_field);
    this->__fbthrift_field_enum_field = std::move(other.__fbthrift_field_enum_field);
    this->__fbthrift_field_list_field = std::move(other.__fbthrift_field_list_field);
    this->__fbthrift_field_set_field = std::move(other.__fbthrift_field_set_field);
    this->__fbthrift_field_map_field = std::move(other.__fbthrift_field_map_field);
    this->__fbthrift_field_struct_field = std::move(other.__fbthrift_field_struct_field);
    this->__fbthrift_field_union_field = std::move(other.__fbthrift_field_union_field);
    __isset = other.__isset;
    return *this;
}


FieldLevelTerseStruct::FieldLevelTerseStruct(apache::thrift::FragileConstructor, bool terse_bool_field__arg, ::std::int8_t terse_byte_field__arg, ::std::int16_t terse_short_field__arg, ::std::int32_t terse_int_field__arg, ::std::int64_t terse_long_field__arg, float terse_float_field__arg, double terse_double_field__arg, ::std::string terse_string_field__arg, ::std::string terse_binary_field__arg, ::facebook::thrift::test::terse_write::MyEnum terse_enum_field__arg, ::std::vector<::std::int16_t> terse_list_field__arg, ::std::set<::std::int16_t> terse_set_field__arg, ::std::map<::std::int16_t, ::std::int16_t> terse_map_field__arg, ::facebook::thrift::test::terse_write::MyStruct terse_struct_field__arg, ::facebook::thrift::test::terse_write::MyUnion terse_union_field__arg, bool bool_field__arg, ::std::int8_t byte_field__arg, ::std::int16_t short_field__arg, ::std::int32_t int_field__arg, ::std::int64_t long_field__arg, float float_field__arg, double double_field__arg, ::std::string string_field__arg, ::std::string binary_field__arg, ::facebook::thrift::test::terse_write::MyEnum enum_field__arg, ::std::vector<::std::int16_t> list_field__arg, ::std::set<::std::int16_t> set_field__arg, ::std::map<::std::int16_t, ::std::int16_t> map_field__arg, ::facebook::thrift::test::terse_write::MyStruct struct_field__arg, ::facebook::thrift::test::terse_write::MyUnion union_field__arg) :
    __fbthrift_field_terse_bool_field(std::move(terse_bool_field__arg)),
    __fbthrift_field_terse_byte_field(std::move(terse_byte_field__arg)),
    __fbthrift_field_terse_short_field(std::move(terse_short_field__arg)),
    __fbthrift_field_terse_int_field(std::move(terse_int_field__arg)),
    __fbthrift_field_terse_long_field(std::move(terse_long_field__arg)),
    __fbthrift_field_terse_float_field(std::move(terse_float_field__arg)),
    __fbthrift_field_terse_double_field(std::move(terse_double_field__arg)),
    __fbthrift_field_terse_string_field(std::move(terse_string_field__arg)),
    __fbthrift_field_terse_binary_field(std::move(terse_binary_field__arg)),
    __fbthrift_field_terse_enum_field(std::move(terse_enum_field__arg)),
    __fbthrift_field_terse_list_field(std::move(terse_list_field__arg)),
    __fbthrift_field_terse_set_field(std::move(terse_set_field__arg)),
    __fbthrift_field_terse_map_field(std::move(terse_map_field__arg)),
    __fbthrift_field_terse_struct_field(std::move(terse_struct_field__arg)),
    __fbthrift_field_terse_union_field(std::move(terse_union_field__arg)),
    __fbthrift_field_bool_field(std::move(bool_field__arg)),
    __fbthrift_field_byte_field(std::move(byte_field__arg)),
    __fbthrift_field_short_field(std::move(short_field__arg)),
    __fbthrift_field_int_field(std::move(int_field__arg)),
    __fbthrift_field_long_field(std::move(long_field__arg)),
    __fbthrift_field_float_field(std::move(float_field__arg)),
    __fbthrift_field_double_field(std::move(double_field__arg)),
    __fbthrift_field_string_field(std::move(string_field__arg)),
    __fbthrift_field_binary_field(std::move(binary_field__arg)),
    __fbthrift_field_enum_field(std::move(enum_field__arg)),
    __fbthrift_field_list_field(std::move(list_field__arg)),
    __fbthrift_field_set_field(std::move(set_field__arg)),
    __fbthrift_field_map_field(std::move(map_field__arg)),
    __fbthrift_field_struct_field(std::move(struct_field__arg)),
    __fbthrift_field_union_field(std::move(union_field__arg)) { 
  __isset.set(folly::index_constant<0>(), true);
  __isset.set(folly::index_constant<1>(), true);
  __isset.set(folly::index_constant<2>(), true);
  __isset.set(folly::index_constant<3>(), true);
  __isset.set(folly::index_constant<4>(), true);
  __isset.set(folly::index_constant<5>(), true);
  __isset.set(folly::index_constant<6>(), true);
  __isset.set(folly::index_constant<7>(), true);
  __isset.set(folly::index_constant<8>(), true);
  __isset.set(folly::index_constant<9>(), true);
  __isset.set(folly::index_constant<10>(), true);
  __isset.set(folly::index_constant<11>(), true);
  __isset.set(folly::index_constant<12>(), true);
  __isset.set(folly::index_constant<13>(), true);
  __isset.set(folly::index_constant<14>(), true);
}


void FieldLevelTerseStruct::__fbthrift_clear() {
  // clear all fields
  this->__fbthrift_field_terse_bool_field = bool();
  this->__fbthrift_field_terse_byte_field = ::std::int8_t();
  this->__fbthrift_field_terse_short_field = ::std::int16_t();
  this->__fbthrift_field_terse_int_field = ::std::int32_t();
  this->__fbthrift_field_terse_long_field = ::std::int64_t();
  this->__fbthrift_field_terse_float_field = float();
  this->__fbthrift_field_terse_double_field = double();
  this->__fbthrift_field_terse_string_field = apache::thrift::StringTraits<std::string>::fromStringLiteral("");
  this->__fbthrift_field_terse_binary_field = apache::thrift::StringTraits<std::string>::fromStringLiteral("");
  this->__fbthrift_field_terse_enum_field = ::facebook::thrift::test::terse_write::MyEnum();
  this->__fbthrift_field_terse_list_field.clear();
  this->__fbthrift_field_terse_set_field.clear();
  this->__fbthrift_field_terse_map_field.clear();
  ::apache::thrift::clear(this->__fbthrift_field_terse_union_field);
  this->__fbthrift_field_bool_field = bool();
  this->__fbthrift_field_byte_field = ::std::int8_t();
  this->__fbthrift_field_short_field = ::std::int16_t();
  this->__fbthrift_field_int_field = ::std::int32_t();
  this->__fbthrift_field_long_field = ::std::int64_t();
  this->__fbthrift_field_float_field = float();
  this->__fbthrift_field_double_field = double();
  this->__fbthrift_field_string_field = apache::thrift::StringTraits<std::string>::fromStringLiteral("");
  this->__fbthrift_field_binary_field = apache::thrift::StringTraits<std::string>::fromStringLiteral("");
  this->__fbthrift_field_enum_field = ::facebook::thrift::test::terse_write::MyEnum();
  this->__fbthrift_field_list_field.clear();
  this->__fbthrift_field_set_field.clear();
  this->__fbthrift_field_map_field.clear();
  ::apache::thrift::clear(this->__fbthrift_field_union_field);
  __isset = {};
}

void FieldLevelTerseStruct::__fbthrift_clear_terse_fields() {
  this->__fbthrift_field_terse_bool_field = bool();
  this->__fbthrift_field_terse_byte_field = ::std::int8_t();
  this->__fbthrift_field_terse_short_field = ::std::int16_t();
  this->__fbthrift_field_terse_int_field = ::std::int32_t();
  this->__fbthrift_field_terse_long_field = ::std::int64_t();
  this->__fbthrift_field_terse_float_field = float();
  this->__fbthrift_field_terse_double_field = double();
  this->__fbthrift_field_terse_string_field = apache::thrift::StringTraits<std::string>::fromStringLiteral("");
  this->__fbthrift_field_terse_binary_field = apache::thrift::StringTraits<std::string>::fromStringLiteral("");
  this->__fbthrift_field_terse_enum_field = ::facebook::thrift::test::terse_write::MyEnum();
  this->__fbthrift_field_terse_list_field.clear();
  this->__fbthrift_field_terse_set_field.clear();
  this->__fbthrift_field_terse_map_field.clear();
  ::apache::thrift::clear(this->__fbthrift_field_terse_union_field);
}

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

bool FieldLevelTerseStruct::operator==([[maybe_unused]] const FieldLevelTerseStruct& rhs) const {
  return ::apache::thrift::op::detail::StructEquality{}(*this, rhs);
}

bool FieldLevelTerseStruct::operator<([[maybe_unused]] const FieldLevelTerseStruct& rhs) const {
  return ::apache::thrift::op::detail::StructLessThan{}(*this, rhs);
}

const ::std::vector<::std::int16_t>& FieldLevelTerseStruct::get_list_field() const& {
  return __fbthrift_field_list_field;
}

::std::vector<::std::int16_t> FieldLevelTerseStruct::get_list_field() && {
  return std::move(__fbthrift_field_list_field);
}

const ::std::set<::std::int16_t>& FieldLevelTerseStruct::get_set_field() const& {
  return __fbthrift_field_set_field;
}

::std::set<::std::int16_t> FieldLevelTerseStruct::get_set_field() && {
  return std::move(__fbthrift_field_set_field);
}

const ::std::map<::std::int16_t, ::std::int16_t>& FieldLevelTerseStruct::get_map_field() const& {
  return __fbthrift_field_map_field;
}

::std::map<::std::int16_t, ::std::int16_t> FieldLevelTerseStruct::get_map_field() && {
  return std::move(__fbthrift_field_map_field);
}

const ::facebook::thrift::test::terse_write::MyStruct& FieldLevelTerseStruct::get_struct_field() const& {
  return __fbthrift_field_struct_field;
}

::facebook::thrift::test::terse_write::MyStruct FieldLevelTerseStruct::get_struct_field() && {
  return std::move(__fbthrift_field_struct_field);
}

const ::facebook::thrift::test::terse_write::MyUnion& FieldLevelTerseStruct::get_union_field() const& {
  return __fbthrift_field_union_field;
}

::facebook::thrift::test::terse_write::MyUnion FieldLevelTerseStruct::get_union_field() && {
  return std::move(__fbthrift_field_union_field);
}


void swap([[maybe_unused]] FieldLevelTerseStruct& a, [[maybe_unused]] FieldLevelTerseStruct& b) {
  using ::std::swap;
  swap(a.__fbthrift_field_terse_bool_field, b.__fbthrift_field_terse_bool_field);
  swap(a.__fbthrift_field_terse_byte_field, b.__fbthrift_field_terse_byte_field);
  swap(a.__fbthrift_field_terse_short_field, b.__fbthrift_field_terse_short_field);
  swap(a.__fbthrift_field_terse_int_field, b.__fbthrift_field_terse_int_field);
  swap(a.__fbthrift_field_terse_long_field, b.__fbthrift_field_terse_long_field);
  swap(a.__fbthrift_field_terse_float_field, b.__fbthrift_field_terse_float_field);
  swap(a.__fbthrift_field_terse_double_field, b.__fbthrift_field_terse_double_field);
  swap(a.__fbthrift_field_terse_string_field, b.__fbthrift_field_terse_string_field);
  swap(a.__fbthrift_field_terse_binary_field, b.__fbthrift_field_terse_binary_field);
  swap(a.__fbthrift_field_terse_enum_field, b.__fbthrift_field_terse_enum_field);
  swap(a.__fbthrift_field_terse_list_field, b.__fbthrift_field_terse_list_field);
  swap(a.__fbthrift_field_terse_set_field, b.__fbthrift_field_terse_set_field);
  swap(a.__fbthrift_field_terse_map_field, b.__fbthrift_field_terse_map_field);
  swap(a.__fbthrift_field_terse_struct_field, b.__fbthrift_field_terse_struct_field);
  swap(a.__fbthrift_field_terse_union_field, b.__fbthrift_field_terse_union_field);
  swap(a.__fbthrift_field_bool_field, b.__fbthrift_field_bool_field);
  swap(a.__fbthrift_field_byte_field, b.__fbthrift_field_byte_field);
  swap(a.__fbthrift_field_short_field, b.__fbthrift_field_short_field);
  swap(a.__fbthrift_field_int_field, b.__fbthrift_field_int_field);
  swap(a.__fbthrift_field_long_field, b.__fbthrift_field_long_field);
  swap(a.__fbthrift_field_float_field, b.__fbthrift_field_float_field);
  swap(a.__fbthrift_field_double_field, b.__fbthrift_field_double_field);
  swap(a.__fbthrift_field_string_field, b.__fbthrift_field_string_field);
  swap(a.__fbthrift_field_binary_field, b.__fbthrift_field_binary_field);
  swap(a.__fbthrift_field_enum_field, b.__fbthrift_field_enum_field);
  swap(a.__fbthrift_field_list_field, b.__fbthrift_field_list_field);
  swap(a.__fbthrift_field_set_field, b.__fbthrift_field_set_field);
  swap(a.__fbthrift_field_map_field, b.__fbthrift_field_map_field);
  swap(a.__fbthrift_field_struct_field, b.__fbthrift_field_struct_field);
  swap(a.__fbthrift_field_union_field, b.__fbthrift_field_union_field);
  swap(a.__isset, b.__isset);
}

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

static_assert(
    ::apache::thrift::detail::st::gen_check_json<
        FieldLevelTerseStruct,
        ::apache::thrift::type_class::structure,
        ::facebook::thrift::test::terse_write::MyStruct>,
    "inconsistent use of json option");
static_assert(
    ::apache::thrift::detail::st::gen_check_json<
        FieldLevelTerseStruct,
        ::apache::thrift::type_class::variant,
        ::facebook::thrift::test::terse_write::MyUnion>,
    "inconsistent use of json option");
static_assert(
    ::apache::thrift::detail::st::gen_check_json<
        FieldLevelTerseStruct,
        ::apache::thrift::type_class::structure,
        ::facebook::thrift::test::terse_write::MyStruct>,
    "inconsistent use of json option");
static_assert(
    ::apache::thrift::detail::st::gen_check_json<
        FieldLevelTerseStruct,
        ::apache::thrift::type_class::variant,
        ::facebook::thrift::test::terse_write::MyUnion>,
    "inconsistent use of json option");

} // namespace facebook::thrift::test::terse_write

namespace apache {
namespace thrift {
namespace detail {

void TccStructTraits<::facebook::thrift::test::terse_write::TerseStructWithCustomDefault>::translateFieldName(
    std::string_view _fname,
    int16_t& fid,
    apache::thrift::protocol::TType& _ftype) noexcept {
  using data = apache::thrift::TStructDataStorage<::facebook::thrift::test::terse_write::TerseStructWithCustomDefault>;
  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 facebook::thrift::test::terse_write {

const char* TerseStructWithCustomDefault::__fbthrift_thrift_uri() {
  return "facebook.com/thrift/test/terse_write/TerseStructWithCustomDefault";
}

std::string_view TerseStructWithCustomDefault::__fbthrift_get_field_name(::apache::thrift::FieldOrdinal ord) {
  if (ord == ::apache::thrift::FieldOrdinal{0}) { return {}; }
  return apache::thrift::TStructDataStorage<TerseStructWithCustomDefault>::fields_names[folly::to_underlying(ord) - 1];
}
std::string_view TerseStructWithCustomDefault::__fbthrift_get_class_name() {
  return apache::thrift::TStructDataStorage<TerseStructWithCustomDefault>::name;
}

TerseStructWithCustomDefault::TerseStructWithCustomDefault(const TerseStructWithCustomDefault&) = default;
TerseStructWithCustomDefault& TerseStructWithCustomDefault::operator=(const TerseStructWithCustomDefault&) = default;
TerseStructWithCustomDefault::TerseStructWithCustomDefault() :
    __fbthrift_field_bool_field(true),
    __fbthrift_field_byte_field(static_cast<::std::int8_t>(1)),
    __fbthrift_field_short_field(static_cast<::std::int16_t>(2)),
    __fbthrift_field_int_field(static_cast<::std::int32_t>(3)),
    __fbthrift_field_long_field(static_cast<::std::int64_t>(4)),
    __fbthrift_field_float_field(static_cast<float>(5)),
    __fbthrift_field_double_field(static_cast<double>(6)),
    __fbthrift_field_string_field(apache::thrift::StringTraits<std::string>::fromStringLiteral("7")),
    __fbthrift_field_binary_field(apache::thrift::StringTraits<std::string>::fromStringLiteral("8")),
    __fbthrift_field_enum_field( ::facebook::thrift::test::terse_write::MyEnum::ME1),
    __fbthrift_field_list_field(std::initializer_list<::std::int16_t>{ static_cast<::std::int16_t>(1) }),
    __fbthrift_field_set_field(std::initializer_list<::std::int16_t>{ static_cast<::std::int16_t>(1) }),
    __fbthrift_field_map_field(std::initializer_list<::std::map<::std::int16_t, ::std::int16_t>::value_type>{ { static_cast<::std::int16_t>(1), static_cast<::std::int16_t>(1) } }) {
}


TerseStructWithCustomDefault::~TerseStructWithCustomDefault() {}

TerseStructWithCustomDefault::TerseStructWithCustomDefault([[maybe_unused]] TerseStructWithCustomDefault&& other) noexcept :
    __fbthrift_field_bool_field(std::move(other.__fbthrift_field_bool_field)),
    __fbthrift_field_byte_field(std::move(other.__fbthrift_field_byte_field)),
    __fbthrift_field_short_field(std::move(other.__fbthrift_field_short_field)),
    __fbthrift_field_int_field(std::move(other.__fbthrift_field_int_field)),
    __fbthrift_field_long_field(std::move(other.__fbthrift_field_long_field)),
    __fbthrift_field_float_field(std::move(other.__fbthrift_field_float_field)),
    __fbthrift_field_double_field(std::move(other.__fbthrift_field_double_field)),
    __fbthrift_field_string_field(std::move(other.__fbthrift_field_string_field)),
    __fbthrift_field_binary_field(std::move(other.__fbthrift_field_binary_field)),
    __fbthrift_field_enum_field(std::move(other.__fbthrift_field_enum_field)),
    __fbthrift_field_list_field(std::move(other.__fbthrift_field_list_field)),
    __fbthrift_field_set_field(std::move(other.__fbthrift_field_set_field)),
    __fbthrift_field_map_field(std::move(other.__fbthrift_field_map_field)),
    __fbthrift_field_struct_field(std::move(other.__fbthrift_field_struct_field)) {
}

TerseStructWithCustomDefault& TerseStructWithCustomDefault::operator=([[maybe_unused]] TerseStructWithCustomDefault&& other) noexcept {
    this->__fbthrift_field_bool_field = std::move(other.__fbthrift_field_bool_field);
    this->__fbthrift_field_byte_field = std::move(other.__fbthrift_field_byte_field);
    this->__fbthrift_field_short_field = std::move(other.__fbthrift_field_short_field);
    this->__fbthrift_field_int_field = std::move(other.__fbthrift_field_int_field);
    this->__fbthrift_field_long_field = std::move(other.__fbthrift_field_long_field);
    this->__fbthrift_field_float_field = std::move(other.__fbthrift_field_float_field);
    this->__fbthrift_field_double_field = std::move(other.__fbthrift_field_double_field);
    this->__fbthrift_field_string_field = std::move(other.__fbthrift_field_string_field);
    this->__fbthrift_field_binary_field = std::move(other.__fbthrift_field_binary_field);
    this->__fbthrift_field_enum_field = std::move(other.__fbthrift_field_enum_field);
    this->__fbthrift_field_list_field = std::move(other.__fbthrift_field_list_field);
    this->__fbthrift_field_set_field = std::move(other.__fbthrift_field_set_field);
    this->__fbthrift_field_map_field = std::move(other.__fbthrift_field_map_field);
    this->__fbthrift_field_struct_field = std::move(other.__fbthrift_field_struct_field);
    return *this;
}


TerseStructWithCustomDefault::TerseStructWithCustomDefault(apache::thrift::FragileConstructor, bool bool_field__arg, ::std::int8_t byte_field__arg, ::std::int16_t short_field__arg, ::std::int32_t int_field__arg, ::std::int64_t long_field__arg, float float_field__arg, double double_field__arg, ::std::string string_field__arg, ::std::string binary_field__arg, ::facebook::thrift::test::terse_write::MyEnum enum_field__arg, ::std::vector<::std::int16_t> list_field__arg, ::std::set<::std::int16_t> set_field__arg, ::std::map<::std::int16_t, ::std::int16_t> map_field__arg, ::facebook::thrift::test::terse_write::MyStructWithCustomDefault struct_field__arg) :
    __fbthrift_field_bool_field(std::move(bool_field__arg)),
    __fbthrift_field_byte_field(std::move(byte_field__arg)),
    __fbthrift_field_short_field(std::move(short_field__arg)),
    __fbthrift_field_int_field(std::move(int_field__arg)),
    __fbthrift_field_long_field(std::move(long_field__arg)),
    __fbthrift_field_float_field(std::move(float_field__arg)),
    __fbthrift_field_double_field(std::move(double_field__arg)),
    __fbthrift_field_string_field(std::move(string_field__arg)),
    __fbthrift_field_binary_field(std::move(binary_field__arg)),
    __fbthrift_field_enum_field(std::move(enum_field__arg)),
    __fbthrift_field_list_field(std::move(list_field__arg)),
    __fbthrift_field_set_field(std::move(set_field__arg)),
    __fbthrift_field_map_field(std::move(map_field__arg)),
    __fbthrift_field_struct_field(std::move(struct_field__arg)) { 
}


void TerseStructWithCustomDefault::__fbthrift_clear() {
  // clear all fields
  this->__fbthrift_field_bool_field = bool();
  this->__fbthrift_field_byte_field = ::std::int8_t();
  this->__fbthrift_field_short_field = ::std::int16_t();
  this->__fbthrift_field_int_field = ::std::int32_t();
  this->__fbthrift_field_long_field = ::std::int64_t();
  this->__fbthrift_field_float_field = float();
  this->__fbthrift_field_double_field = double();
  this->__fbthrift_field_string_field = apache::thrift::StringTraits<std::string>::fromStringLiteral("");
  this->__fbthrift_field_binary_field = apache::thrift::StringTraits<std::string>::fromStringLiteral("");
  this->__fbthrift_field_enum_field = ::facebook::thrift::test::terse_write::MyEnum();
  this->__fbthrift_field_list_field.clear();
  this->__fbthrift_field_set_field.clear();
  this->__fbthrift_field_map_field.clear();
  ::apache::thrift::clear(this->__fbthrift_field_struct_field);
}

void TerseStructWithCustomDefault::__fbthrift_clear_terse_fields() {
  this->__fbthrift_field_bool_field = bool();
  this->__fbthrift_field_byte_field = ::std::int8_t();
  this->__fbthrift_field_short_field = ::std::int16_t();
  this->__fbthrift_field_int_field = ::std::int32_t();
  this->__fbthrift_field_long_field = ::std::int64_t();
  this->__fbthrift_field_float_field = float();
  this->__fbthrift_field_double_field = double();
  this->__fbthrift_field_string_field = apache::thrift::StringTraits<std::string>::fromStringLiteral("");
  this->__fbthrift_field_binary_field = apache::thrift::StringTraits<std::string>::fromStringLiteral("");
  this->__fbthrift_field_enum_field = ::facebook::thrift::test::terse_write::MyEnum();
  this->__fbthrift_field_list_field.clear();
  this->__fbthrift_field_set_field.clear();
  this->__fbthrift_field_map_field.clear();
  ::apache::thrift::detail::st::clear_terse_fields(this->__fbthrift_field_struct_field);
}

bool TerseStructWithCustomDefault::__fbthrift_is_empty() const {
  return ::apache::thrift::op::isEmpty<::apache::thrift::type::bool_t>(this->__fbthrift_field_bool_field) &&
 ::apache::thrift::op::isEmpty<::apache::thrift::type::byte_t>(this->__fbthrift_field_byte_field) &&
 ::apache::thrift::op::isEmpty<::apache::thrift::type::i16_t>(this->__fbthrift_field_short_field) &&
 ::apache::thrift::op::isEmpty<::apache::thrift::type::i32_t>(this->__fbthrift_field_int_field) &&
 ::apache::thrift::op::isEmpty<::apache::thrift::type::i64_t>(this->__fbthrift_field_long_field) &&
 ::apache::thrift::op::isEmpty<::apache::thrift::type::float_t>(this->__fbthrift_field_float_field) &&
 ::apache::thrift::op::isEmpty<::apache::thrift::type::double_t>(this->__fbthrift_field_double_field) &&
 ::apache::thrift::op::isEmpty<::apache::thrift::type::string_t>(this->__fbthrift_field_string_field) &&
 ::apache::thrift::op::isEmpty<::apache::thrift::type::binary_t>(this->__fbthrift_field_binary_field) &&
 ::apache::thrift::op::isEmpty<::apache::thrift::type::enum_t<::facebook::thrift::test::terse_write::MyEnum>>(this->__fbthrift_field_enum_field) &&
 ::apache::thrift::op::isEmpty<::apache::thrift::type::list<::apache::thrift::type::i16_t>>(this->__fbthrift_field_list_field) &&
 ::apache::thrift::op::isEmpty<::apache::thrift::type::set<::apache::thrift::type::i16_t>>(this->__fbthrift_field_set_field) &&
 ::apache::thrift::op::isEmpty<::apache::thrift::type::map<::apache::thrift::type::i16_t, ::apache::thrift::type::i16_t>>(this->__fbthrift_field_map_field) &&
 ::apache::thrift::op::isEmpty<::apache::thrift::type::struct_t<::facebook::thrift::test::terse_write::MyStructWithCustomDefault>>(this->__fbthrift_field_struct_field);
}

bool TerseStructWithCustomDefault::operator==([[maybe_unused]] const TerseStructWithCustomDefault& rhs) const {
  return ::apache::thrift::op::detail::StructEquality{}(*this, rhs);
}

bool TerseStructWithCustomDefault::operator<([[maybe_unused]] const TerseStructWithCustomDefault& rhs) const {
  return ::apache::thrift::op::detail::StructLessThan{}(*this, rhs);
}


void swap([[maybe_unused]] TerseStructWithCustomDefault& a, [[maybe_unused]] TerseStructWithCustomDefault& b) {
  using ::std::swap;
  swap(a.__fbthrift_field_bool_field, b.__fbthrift_field_bool_field);
  swap(a.__fbthrift_field_byte_field, b.__fbthrift_field_byte_field);
  swap(a.__fbthrift_field_short_field, b.__fbthrift_field_short_field);
  swap(a.__fbthrift_field_int_field, b.__fbthrift_field_int_field);
  swap(a.__fbthrift_field_long_field, b.__fbthrift_field_long_field);
  swap(a.__fbthrift_field_float_field, b.__fbthrift_field_float_field);
  swap(a.__fbthrift_field_double_field, b.__fbthrift_field_double_field);
  swap(a.__fbthrift_field_string_field, b.__fbthrift_field_string_field);
  swap(a.__fbthrift_field_binary_field, b.__fbthrift_field_binary_field);
  swap(a.__fbthrift_field_enum_field, b.__fbthrift_field_enum_field);
  swap(a.__fbthrift_field_list_field, b.__fbthrift_field_list_field);
  swap(a.__fbthrift_field_set_field, b.__fbthrift_field_set_field);
  swap(a.__fbthrift_field_map_field, b.__fbthrift_field_map_field);
  swap(a.__fbthrift_field_struct_field, b.__fbthrift_field_struct_field);
}

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

static_assert(
    ::apache::thrift::detail::st::gen_check_json<
        TerseStructWithCustomDefault,
        ::apache::thrift::type_class::structure,
        ::facebook::thrift::test::terse_write::MyStructWithCustomDefault>,
    "inconsistent use of json option");

} // namespace facebook::thrift::test::terse_write

namespace apache {
namespace thrift {
namespace detail {

void TccStructTraits<::facebook::thrift::test::terse_write::AdaptedFields>::translateFieldName(
    std::string_view _fname,
    int16_t& fid,
    apache::thrift::protocol::TType& _ftype) noexcept {
  using data = apache::thrift::TStructDataStorage<::facebook::thrift::test::terse_write::AdaptedFields>;
  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 facebook::thrift::test::terse_write {

const char* AdaptedFields::__fbthrift_thrift_uri() {
  return "facebook.com/thrift/test/terse_write/AdaptedFields";
}

std::string_view AdaptedFields::__fbthrift_get_field_name(::apache::thrift::FieldOrdinal ord) {
  if (ord == ::apache::thrift::FieldOrdinal{0}) { return {}; }
  return apache::thrift::TStructDataStorage<AdaptedFields>::fields_names[folly::to_underlying(ord) - 1];
}
std::string_view AdaptedFields::__fbthrift_get_class_name() {
  return apache::thrift::TStructDataStorage<AdaptedFields>::name;
}

AdaptedFields::AdaptedFields(const AdaptedFields& srcObj) :
    __fbthrift_field_field1(srcObj.__fbthrift_field_field1),
    __fbthrift_field_field2(srcObj.__fbthrift_field_field2),
    __fbthrift_field_field3(srcObj.__fbthrift_field_field3) {
  ::apache::thrift::adapt_detail::construct<::my::Adapter, 1>(__fbthrift_field_field1, *this);
  ::apache::thrift::adapt_detail::construct<::my::Adapter, 2>(__fbthrift_field_field2, *this);
  ::apache::thrift::adapt_detail::construct<::my::Adapter, 3>(__fbthrift_field_field3, *this);
}

static void __fbthrift_swap(AdaptedFields& lhs, AdaptedFields& rhs) { swap(lhs, rhs); }
AdaptedFields& AdaptedFields::operator=(const AdaptedFields& other) {
  AdaptedFields tmp(other);
  __fbthrift_swap(*this, tmp);
  return *this;
}

AdaptedFields::AdaptedFields([[maybe_unused]] AdaptedFields&& 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)) {
  ::apache::thrift::adapt_detail::construct<::my::Adapter, 1>(__fbthrift_field_field1, *this);
  ::apache::thrift::adapt_detail::construct<::my::Adapter, 2>(__fbthrift_field_field2, *this);
  ::apache::thrift::adapt_detail::construct<::my::Adapter, 3>(__fbthrift_field_field3, *this);
}

AdaptedFields& AdaptedFields::operator=([[maybe_unused]] AdaptedFields&& 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);
    return *this;
}


AdaptedFields::AdaptedFields(apache::thrift::FragileConstructor, ::facebook::thrift::test::terse_write::MyInteger field1__arg, ::apache::thrift::adapt_detail::adapted_field_t<::my::Adapter, 2, ::std::int32_t, AdaptedFields> field2__arg, ::apache::thrift::adapt_detail::adapted_field_t<::my::Adapter, 3, ::facebook::thrift::test::terse_write::MyInteger, AdaptedFields> field3__arg) :
    __fbthrift_field_field1(std::move(field1__arg)),
    __fbthrift_field_field2(std::move(field2__arg)),
    __fbthrift_field_field3(std::move(field3__arg)) { 
  ::apache::thrift::adapt_detail::construct<::my::Adapter, 1>(__fbthrift_field_field1, *this);
  ::apache::thrift::adapt_detail::construct<::my::Adapter, 2>(__fbthrift_field_field2, *this);
  ::apache::thrift::adapt_detail::construct<::my::Adapter, 3>(__fbthrift_field_field3, *this);
}


void AdaptedFields::__fbthrift_clear() {
  // clear all fields
  ::apache::thrift::adapt_detail::clear<::my::Adapter, 1>(__fbthrift_field_field1, *this);
  ::apache::thrift::adapt_detail::clear<::my::Adapter, 2>(__fbthrift_field_field2, *this);
  ::apache::thrift::adapt_detail::clear<::my::Adapter, 3>(__fbthrift_field_field3, *this);
}

void AdaptedFields::__fbthrift_clear_terse_fields() {
  ::apache::thrift::adapt_detail::clear<::my::Adapter, 1>(__fbthrift_field_field1, *this);
  ::apache::thrift::adapt_detail::clear<::my::Adapter, 2>(__fbthrift_field_field2, *this);
  ::apache::thrift::adapt_detail::clear<::my::Adapter, 3>(__fbthrift_field_field3, *this);
}

bool AdaptedFields::__fbthrift_is_empty() const {
  return ::apache::thrift::op::isEmpty<::apache::thrift::type::adapted<::my::Adapter, ::apache::thrift::type::i32_t>>(this->__fbthrift_field_field1) &&
 ::apache::thrift::op::isEmpty<::apache::thrift::op::get_field_tag<AdaptedFields, ::apache::thrift::field_id<2>>>(this->__fbthrift_field_field2) &&
 ::apache::thrift::op::isEmpty<::apache::thrift::op::get_field_tag<AdaptedFields, ::apache::thrift::field_id<3>>>(this->__fbthrift_field_field3);
}

bool AdaptedFields::operator==([[maybe_unused]] const AdaptedFields& rhs) const {
  return ::apache::thrift::op::detail::StructEquality{}(*this, rhs);
}

bool AdaptedFields::operator<([[maybe_unused]] const AdaptedFields& rhs) const {
  return ::apache::thrift::op::detail::StructLessThan{}(*this, rhs);
}


void swap([[maybe_unused]] AdaptedFields& a, [[maybe_unused]] AdaptedFields& 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);
}

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


} // namespace facebook::thrift::test::terse_write

namespace apache {
namespace thrift {
namespace detail {

void TccStructTraits<::facebook::thrift::test::terse_write::WrappedFields>::translateFieldName(
    std::string_view _fname,
    int16_t& fid,
    apache::thrift::protocol::TType& _ftype) noexcept {
  using data = apache::thrift::TStructDataStorage<::facebook::thrift::test::terse_write::WrappedFields>;
  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 facebook::thrift::test::terse_write {

const char* WrappedFields::__fbthrift_thrift_uri() {
  return "facebook.com/thrift/test/terse_write/WrappedFields";
}

std::string_view WrappedFields::__fbthrift_get_field_name(::apache::thrift::FieldOrdinal ord) {
  if (ord == ::apache::thrift::FieldOrdinal{0}) { return {}; }
  return apache::thrift::TStructDataStorage<WrappedFields>::fields_names[folly::to_underlying(ord) - 1];
}
std::string_view WrappedFields::__fbthrift_get_class_name() {
  return apache::thrift::TStructDataStorage<WrappedFields>::name;
}


WrappedFields::WrappedFields(apache::thrift::FragileConstructor, ::std::int32_t field1__arg) :
    __fbthrift_field_field1(std::move(field1__arg)) { 
}


void WrappedFields::__fbthrift_clear() {
  // clear all fields
  this->__fbthrift_field_field1 = ::std::int32_t();
}

void WrappedFields::__fbthrift_clear_terse_fields() {
  this->__fbthrift_field_field1 = ::std::int32_t();
}

bool WrappedFields::__fbthrift_is_empty() const {
  return ::apache::thrift::op::isEmpty<::apache::thrift::type::i32_t>(this->__fbthrift_field_field1);
}

bool WrappedFields::operator==([[maybe_unused]] const WrappedFields& rhs) const {
  return ::apache::thrift::op::detail::StructEquality{}(*this, rhs);
}

bool WrappedFields::operator<([[maybe_unused]] const WrappedFields& rhs) const {
  return ::apache::thrift::op::detail::StructLessThan{}(*this, rhs);
}


void swap([[maybe_unused]] WrappedFields& a, [[maybe_unused]] WrappedFields& b) {
  using ::std::swap;
  swap(a.__fbthrift_field_field1, b.__fbthrift_field_field1);
}

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


} // namespace facebook::thrift::test::terse_write

namespace apache {
namespace thrift {
namespace detail {

void TccStructTraits<::facebook::thrift::test::terse_write::TerseException>::translateFieldName(
    std::string_view _fname,
    int16_t& fid,
    apache::thrift::protocol::TType& _ftype) noexcept {
  using data = apache::thrift::TStructDataStorage<::facebook::thrift::test::terse_write::TerseException>;
  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 facebook::thrift::test::terse_write {

const char* TerseException::__fbthrift_thrift_uri() {
  return "facebook.com/thrift/test/terse_write/TerseException";
}

std::string_view TerseException::__fbthrift_get_field_name(::apache::thrift::FieldOrdinal ord) {
  if (ord == ::apache::thrift::FieldOrdinal{0}) { return {}; }
  return apache::thrift::TStructDataStorage<TerseException>::fields_names[folly::to_underlying(ord) - 1];
}
std::string_view TerseException::__fbthrift_get_class_name() {
  return apache::thrift::TStructDataStorage<TerseException>::name;
}

TerseException::TerseException(const TerseException&) = default;
TerseException& TerseException::operator=(const TerseException&) = default;
TerseException::TerseException() {
}

TerseException::TerseException(std::string __message) : TerseException() {
  __fbthrift_field_msg = std::move(__message);
}


TerseException::~TerseException() {}

TerseException::TerseException([[maybe_unused]] TerseException&& other) noexcept :
    __fbthrift_field_msg(std::move(other.__fbthrift_field_msg)) {
}

TerseException& TerseException::operator=([[maybe_unused]] TerseException&& other) noexcept {
    this->__fbthrift_field_msg = std::move(other.__fbthrift_field_msg);
    return *this;
}


TerseException::TerseException(apache::thrift::FragileConstructor, ::std::string msg__arg) :
    __fbthrift_field_msg(std::move(msg__arg)) { 
}


void TerseException::__fbthrift_clear() {
  // clear all fields
  this->__fbthrift_field_msg = apache::thrift::StringTraits<std::string>::fromStringLiteral("");
}

void TerseException::__fbthrift_clear_terse_fields() {
  this->__fbthrift_field_msg = apache::thrift::StringTraits<std::string>::fromStringLiteral("");
}

bool TerseException::__fbthrift_is_empty() const {
  return ::apache::thrift::op::isEmpty<::apache::thrift::type::string_t>(this->__fbthrift_field_msg);
}

bool TerseException::operator==([[maybe_unused]] const TerseException& rhs) const {
  return ::apache::thrift::op::detail::StructEquality{}(*this, rhs);
}

bool TerseException::operator<([[maybe_unused]] const TerseException& rhs) const {
  return ::apache::thrift::op::detail::StructLessThan{}(*this, rhs);
}


void swap([[maybe_unused]] TerseException& a, [[maybe_unused]] TerseException& b) {
  using ::std::swap;
  swap(a.__fbthrift_field_msg, b.__fbthrift_field_msg);
}

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


} // namespace facebook::thrift::test::terse_write

namespace facebook::thrift::test::terse_write { namespace {
[[maybe_unused]] FOLLY_ERASE void validateAdapters() {
  ::apache::thrift::adapt_detail::validateFieldAdapter<::my::Adapter, 1, ::std::int32_t, ::facebook::thrift::test::terse_write::AdaptedFields>();
  ::apache::thrift::adapt_detail::validateFieldAdapter<::my::Adapter, 2, ::std::int32_t, ::facebook::thrift::test::terse_write::AdaptedFields>();
  ::apache::thrift::adapt_detail::validateFieldAdapter<::my::Adapter, 3, ::std::int32_t, ::facebook::thrift::test::terse_write::AdaptedFields>();
}
}} // namespace facebook::thrift::test::terse_write
namespace apache::thrift::detail::annotation {
}
