/**
 * Autogenerated by Thrift for thrift/compiler/test/fixtures/lazy_deserialization/src/deprecated_terse_writes.thrift
 *
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
 *  @generated @nocommit
 */
#pragma once

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



namespace apache {
namespace thrift {
namespace ident {
struct field1;
struct field2;
struct field3;
struct field4;
struct field1;
struct field2;
struct field3;
struct field4;
struct field1;
struct field2;
struct field3;
struct field4;
struct field1;
struct field2;
struct field3;
struct field4;
} // namespace ident
namespace detail {
#ifndef APACHE_THRIFT_ACCESSOR_field1
#define APACHE_THRIFT_ACCESSOR_field1
APACHE_THRIFT_DEFINE_ACCESSOR(field1);
#endif
#ifndef APACHE_THRIFT_ACCESSOR_field2
#define APACHE_THRIFT_ACCESSOR_field2
APACHE_THRIFT_DEFINE_ACCESSOR(field2);
#endif
#ifndef APACHE_THRIFT_ACCESSOR_field3
#define APACHE_THRIFT_ACCESSOR_field3
APACHE_THRIFT_DEFINE_ACCESSOR(field3);
#endif
#ifndef APACHE_THRIFT_ACCESSOR_field4
#define APACHE_THRIFT_ACCESSOR_field4
APACHE_THRIFT_DEFINE_ACCESSOR(field4);
#endif
#ifndef APACHE_THRIFT_ACCESSOR_field1
#define APACHE_THRIFT_ACCESSOR_field1
APACHE_THRIFT_DEFINE_ACCESSOR(field1);
#endif
#ifndef APACHE_THRIFT_ACCESSOR_field2
#define APACHE_THRIFT_ACCESSOR_field2
APACHE_THRIFT_DEFINE_ACCESSOR(field2);
#endif
#ifndef APACHE_THRIFT_ACCESSOR_field3
#define APACHE_THRIFT_ACCESSOR_field3
APACHE_THRIFT_DEFINE_ACCESSOR(field3);
#endif
#ifndef APACHE_THRIFT_ACCESSOR_field4
#define APACHE_THRIFT_ACCESSOR_field4
APACHE_THRIFT_DEFINE_ACCESSOR(field4);
#endif
#ifndef APACHE_THRIFT_ACCESSOR_field1
#define APACHE_THRIFT_ACCESSOR_field1
APACHE_THRIFT_DEFINE_ACCESSOR(field1);
#endif
#ifndef APACHE_THRIFT_ACCESSOR_field2
#define APACHE_THRIFT_ACCESSOR_field2
APACHE_THRIFT_DEFINE_ACCESSOR(field2);
#endif
#ifndef APACHE_THRIFT_ACCESSOR_field3
#define APACHE_THRIFT_ACCESSOR_field3
APACHE_THRIFT_DEFINE_ACCESSOR(field3);
#endif
#ifndef APACHE_THRIFT_ACCESSOR_field4
#define APACHE_THRIFT_ACCESSOR_field4
APACHE_THRIFT_DEFINE_ACCESSOR(field4);
#endif
#ifndef APACHE_THRIFT_ACCESSOR_field1
#define APACHE_THRIFT_ACCESSOR_field1
APACHE_THRIFT_DEFINE_ACCESSOR(field1);
#endif
#ifndef APACHE_THRIFT_ACCESSOR_field2
#define APACHE_THRIFT_ACCESSOR_field2
APACHE_THRIFT_DEFINE_ACCESSOR(field2);
#endif
#ifndef APACHE_THRIFT_ACCESSOR_field3
#define APACHE_THRIFT_ACCESSOR_field3
APACHE_THRIFT_DEFINE_ACCESSOR(field3);
#endif
#ifndef APACHE_THRIFT_ACCESSOR_field4
#define APACHE_THRIFT_ACCESSOR_field4
APACHE_THRIFT_DEFINE_ACCESSOR(field4);
#endif
} // namespace detail
} // namespace thrift
} // namespace apache

// BEGIN declare_enums

// END declare_enums
// BEGIN forward_declare
namespace apache::thrift::test {
class TerseFoo;
class TerseLazyFoo;
class TerseOptionalFoo;
class TerseOptionalLazyFoo;
} // namespace apache::thrift::test
// END forward_declare
namespace apache::thrift::detail::annotation {
} // namespace apache::thrift::detail::annotation

namespace apache::thrift::detail::qualifier {
} // namespace apache::thrift::detail::qualifier

// BEGIN hash_and_equal_to
// END hash_and_equal_to
namespace apache::thrift::test {
using ::apache::thrift::detail::operator!=;
using ::apache::thrift::detail::operator>;
using ::apache::thrift::detail::operator<=;
using ::apache::thrift::detail::operator>=;


/** Glean {"file": "thrift/compiler/test/fixtures/lazy_deserialization/src/deprecated_terse_writes.thrift", "name": "TerseFoo", "kind": "struct" } */
class TerseFoo final  {
 private:
  friend struct ::apache::thrift::detail::st::struct_private_access;
  template<class> friend struct ::apache::thrift::detail::invoke_reffer;

  //  used by a static_assert in the corresponding source
  static constexpr bool __fbthrift_cpp2_gen_json = false;
  static constexpr bool __fbthrift_cpp2_is_runtime_annotation = false;
  static std::string_view __fbthrift_get_field_name(::apache::thrift::FieldOrdinal ord);
  static std::string_view __fbthrift_get_class_name();
  using __fbthrift_reflection_ident_list = folly::tag_t<
    ::apache::thrift::ident::field1,
    ::apache::thrift::ident::field2,
    ::apache::thrift::ident::field3,
    ::apache::thrift::ident::field4
  >;

  static constexpr std::int16_t __fbthrift_reflection_field_id_list[] = {0,1,2,3,4};
  using __fbthrift_reflection_type_tags = folly::tag_t<
    ::apache::thrift::type::list<::apache::thrift::type::double_t>,
    ::apache::thrift::type::list<::apache::thrift::type::i32_t>,
    ::apache::thrift::type::list<::apache::thrift::type::double_t>,
    ::apache::thrift::type::list<::apache::thrift::type::i32_t>
  >;

  static constexpr std::size_t __fbthrift_field_size_v = 4;

  template<class T>
  using __fbthrift_id = ::apache::thrift::type::field_id<__fbthrift_reflection_field_id_list[folly::to_underlying(T::value)]>;

  template<class T>
  using __fbthrift_type_tag = ::apache::thrift::detail::at<__fbthrift_reflection_type_tags, T::value>;

  template<class T>
  using __fbthrift_ident = ::apache::thrift::detail::at<__fbthrift_reflection_ident_list, T::value>;

  template<class T> using __fbthrift_ordinal = ::apache::thrift::type::ordinal_tag<
    ::apache::thrift::detail::getFieldOrdinal<T,
                                              __fbthrift_reflection_ident_list,
                                              __fbthrift_reflection_type_tags>(
      __fbthrift_reflection_field_id_list
    )
  >;
  void __fbthrift_clear();
  void __fbthrift_clear_terse_fields();
  bool __fbthrift_is_empty() const;

 public:
  using __fbthrift_cpp2_type = TerseFoo;
  static constexpr bool __fbthrift_cpp2_is_union =
    false;
  static constexpr bool __fbthrift_cpp2_uses_op_encode =
    false;


 public:

  TerseFoo();

  // FragileConstructor for use in initialization lists only.
  [[deprecated("This constructor is deprecated")]]
  TerseFoo(apache::thrift::FragileConstructor, ::std::vector<double> field1__arg, ::std::vector<::std::int32_t> field2__arg, ::std::vector<double> field3__arg, ::std::vector<::std::int32_t> field4__arg);

  TerseFoo(TerseFoo&&) noexcept;

  TerseFoo(const TerseFoo& src);


  TerseFoo& operator=(TerseFoo&&) noexcept;
  TerseFoo& operator=(const TerseFoo& src);

  ~TerseFoo();

 private:
  ::std::vector<double> __fbthrift_field_field1;
 private:
  ::std::vector<::std::int32_t> __fbthrift_field_field2;
 private:
  ::std::vector<double> __fbthrift_field_field3;
 private:
  ::std::vector<::std::int32_t> __fbthrift_field_field4;
 private:
  apache::thrift::detail::isset_bitset<4, apache::thrift::detail::IssetBitsetOption::Unpacked> __isset;

 public:

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

  /** Glean { "field": "field1" } */
  template <typename..., typename T = ::std::vector<double>>
  FOLLY_ERASE ::apache::thrift::field_ref<const T&> field1_ref() const& {
    return {this->__fbthrift_field_field1, __isset.at(0), __isset.bit(0)};
  }

  /** Glean { "field": "field1" } */
  template <typename..., typename T = ::std::vector<double>>
  FOLLY_ERASE ::apache::thrift::field_ref<const T&&> field1_ref() const&& {
    return {static_cast<const T&&>(this->__fbthrift_field_field1), __isset.at(0), __isset.bit(0)};
  }

  /** Glean { "field": "field1" } */
  template <typename..., typename T = ::std::vector<double>>
  FOLLY_ERASE ::apache::thrift::field_ref<T&> field1_ref() & {
    return {this->__fbthrift_field_field1, __isset.at(0), __isset.bit(0)};
  }

  /** Glean { "field": "field1" } */
  template <typename..., typename T = ::std::vector<double>>
  FOLLY_ERASE ::apache::thrift::field_ref<T&&> field1_ref() && {
    return {static_cast<T&&>(this->__fbthrift_field_field1), __isset.at(0), __isset.bit(0)};
  }

  /** Glean { "field": "field1" } */
  template <typename..., typename T = ::std::vector<double>>
  FOLLY_ERASE ::apache::thrift::field_ref<const T&> field1() const& {
    return {this->__fbthrift_field_field1, __isset.at(0), __isset.bit(0)};
  }

  /** Glean { "field": "field1" } */
  template <typename..., typename T = ::std::vector<double>>
  FOLLY_ERASE ::apache::thrift::field_ref<const T&&> field1() const&& {
    return {static_cast<const T&&>(this->__fbthrift_field_field1), __isset.at(0), __isset.bit(0)};
  }

  /** Glean { "field": "field1" } */
  template <typename..., typename T = ::std::vector<double>>
  FOLLY_ERASE ::apache::thrift::field_ref<T&> field1() & {
    return {this->__fbthrift_field_field1, __isset.at(0), __isset.bit(0)};
  }

  /** Glean { "field": "field1" } */
  template <typename..., typename T = ::std::vector<double>>
  FOLLY_ERASE ::apache::thrift::field_ref<T&&> field1() && {
    return {static_cast<T&&>(this->__fbthrift_field_field1), __isset.at(0), __isset.bit(0)};
  }

  /** Glean { "field": "field2" } */
  template <typename..., typename T = ::std::vector<::std::int32_t>>
  FOLLY_ERASE ::apache::thrift::field_ref<const T&> field2_ref() const& {
    return {this->__fbthrift_field_field2, __isset.at(1), __isset.bit(1)};
  }

  /** Glean { "field": "field2" } */
  template <typename..., typename T = ::std::vector<::std::int32_t>>
  FOLLY_ERASE ::apache::thrift::field_ref<const T&&> field2_ref() const&& {
    return {static_cast<const T&&>(this->__fbthrift_field_field2), __isset.at(1), __isset.bit(1)};
  }

  /** Glean { "field": "field2" } */
  template <typename..., typename T = ::std::vector<::std::int32_t>>
  FOLLY_ERASE ::apache::thrift::field_ref<T&> field2_ref() & {
    return {this->__fbthrift_field_field2, __isset.at(1), __isset.bit(1)};
  }

  /** Glean { "field": "field2" } */
  template <typename..., typename T = ::std::vector<::std::int32_t>>
  FOLLY_ERASE ::apache::thrift::field_ref<T&&> field2_ref() && {
    return {static_cast<T&&>(this->__fbthrift_field_field2), __isset.at(1), __isset.bit(1)};
  }

  /** Glean { "field": "field2" } */
  template <typename..., typename T = ::std::vector<::std::int32_t>>
  FOLLY_ERASE ::apache::thrift::field_ref<const T&> field2() const& {
    return {this->__fbthrift_field_field2, __isset.at(1), __isset.bit(1)};
  }

  /** Glean { "field": "field2" } */
  template <typename..., typename T = ::std::vector<::std::int32_t>>
  FOLLY_ERASE ::apache::thrift::field_ref<const T&&> field2() const&& {
    return {static_cast<const T&&>(this->__fbthrift_field_field2), __isset.at(1), __isset.bit(1)};
  }

  /** Glean { "field": "field2" } */
  template <typename..., typename T = ::std::vector<::std::int32_t>>
  FOLLY_ERASE ::apache::thrift::field_ref<T&> field2() & {
    return {this->__fbthrift_field_field2, __isset.at(1), __isset.bit(1)};
  }

  /** Glean { "field": "field2" } */
  template <typename..., typename T = ::std::vector<::std::int32_t>>
  FOLLY_ERASE ::apache::thrift::field_ref<T&&> field2() && {
    return {static_cast<T&&>(this->__fbthrift_field_field2), __isset.at(1), __isset.bit(1)};
  }

  /** Glean { "field": "field3" } */
  template <typename..., typename T = ::std::vector<double>>
  FOLLY_ERASE ::apache::thrift::field_ref<const T&> field3_ref() const& {
    return {this->__fbthrift_field_field3, __isset.at(2), __isset.bit(2)};
  }

  /** Glean { "field": "field3" } */
  template <typename..., typename T = ::std::vector<double>>
  FOLLY_ERASE ::apache::thrift::field_ref<const T&&> field3_ref() const&& {
    return {static_cast<const T&&>(this->__fbthrift_field_field3), __isset.at(2), __isset.bit(2)};
  }

  /** Glean { "field": "field3" } */
  template <typename..., typename T = ::std::vector<double>>
  FOLLY_ERASE ::apache::thrift::field_ref<T&> field3_ref() & {
    return {this->__fbthrift_field_field3, __isset.at(2), __isset.bit(2)};
  }

  /** Glean { "field": "field3" } */
  template <typename..., typename T = ::std::vector<double>>
  FOLLY_ERASE ::apache::thrift::field_ref<T&&> field3_ref() && {
    return {static_cast<T&&>(this->__fbthrift_field_field3), __isset.at(2), __isset.bit(2)};
  }

  /** Glean { "field": "field3" } */
  template <typename..., typename T = ::std::vector<double>>
  FOLLY_ERASE ::apache::thrift::field_ref<const T&> field3() const& {
    return {this->__fbthrift_field_field3, __isset.at(2), __isset.bit(2)};
  }

  /** Glean { "field": "field3" } */
  template <typename..., typename T = ::std::vector<double>>
  FOLLY_ERASE ::apache::thrift::field_ref<const T&&> field3() const&& {
    return {static_cast<const T&&>(this->__fbthrift_field_field3), __isset.at(2), __isset.bit(2)};
  }

  /** Glean { "field": "field3" } */
  template <typename..., typename T = ::std::vector<double>>
  FOLLY_ERASE ::apache::thrift::field_ref<T&> field3() & {
    return {this->__fbthrift_field_field3, __isset.at(2), __isset.bit(2)};
  }

  /** Glean { "field": "field3" } */
  template <typename..., typename T = ::std::vector<double>>
  FOLLY_ERASE ::apache::thrift::field_ref<T&&> field3() && {
    return {static_cast<T&&>(this->__fbthrift_field_field3), __isset.at(2), __isset.bit(2)};
  }

  /** Glean { "field": "field4" } */
  template <typename..., typename T = ::std::vector<::std::int32_t>>
  FOLLY_ERASE ::apache::thrift::field_ref<const T&> field4_ref() const& {
    return {this->__fbthrift_field_field4, __isset.at(3), __isset.bit(3)};
  }

  /** Glean { "field": "field4" } */
  template <typename..., typename T = ::std::vector<::std::int32_t>>
  FOLLY_ERASE ::apache::thrift::field_ref<const T&&> field4_ref() const&& {
    return {static_cast<const T&&>(this->__fbthrift_field_field4), __isset.at(3), __isset.bit(3)};
  }

  /** Glean { "field": "field4" } */
  template <typename..., typename T = ::std::vector<::std::int32_t>>
  FOLLY_ERASE ::apache::thrift::field_ref<T&> field4_ref() & {
    return {this->__fbthrift_field_field4, __isset.at(3), __isset.bit(3)};
  }

  /** Glean { "field": "field4" } */
  template <typename..., typename T = ::std::vector<::std::int32_t>>
  FOLLY_ERASE ::apache::thrift::field_ref<T&&> field4_ref() && {
    return {static_cast<T&&>(this->__fbthrift_field_field4), __isset.at(3), __isset.bit(3)};
  }

  /** Glean { "field": "field4" } */
  template <typename..., typename T = ::std::vector<::std::int32_t>>
  FOLLY_ERASE ::apache::thrift::field_ref<const T&> field4() const& {
    return {this->__fbthrift_field_field4, __isset.at(3), __isset.bit(3)};
  }

  /** Glean { "field": "field4" } */
  template <typename..., typename T = ::std::vector<::std::int32_t>>
  FOLLY_ERASE ::apache::thrift::field_ref<const T&&> field4() const&& {
    return {static_cast<const T&&>(this->__fbthrift_field_field4), __isset.at(3), __isset.bit(3)};
  }

  /** Glean { "field": "field4" } */
  template <typename..., typename T = ::std::vector<::std::int32_t>>
  FOLLY_ERASE ::apache::thrift::field_ref<T&> field4() & {
    return {this->__fbthrift_field_field4, __isset.at(3), __isset.bit(3)};
  }

  /** Glean { "field": "field4" } */
  template <typename..., typename T = ::std::vector<::std::int32_t>>
  FOLLY_ERASE ::apache::thrift::field_ref<T&&> field4() && {
    return {static_cast<T&&>(this->__fbthrift_field_field4), __isset.at(3), __isset.bit(3)};
  }
  /** Glean { "field": "field1" } */
  const ::std::vector<double>& get_field1() const&;
  /** Glean { "field": "field1" } */
  ::std::vector<double> get_field1() &&;

  /** Glean { "field": "field1" } */
  template <typename T_TerseFoo_field1_struct_setter = ::std::vector<double>>
  [[deprecated("Use `FOO.field1() = BAR;` instead of `FOO.set_field1(BAR);`")]]
  ::std::vector<double>& set_field1(T_TerseFoo_field1_struct_setter&& field1_) {
    field1_ref() = std::forward<T_TerseFoo_field1_struct_setter>(field1_);
    return __fbthrift_field_field1;
  }
  /** Glean { "field": "field2" } */
  const ::std::vector<::std::int32_t>& get_field2() const&;
  /** Glean { "field": "field2" } */
  ::std::vector<::std::int32_t> get_field2() &&;

  /** Glean { "field": "field2" } */
  template <typename T_TerseFoo_field2_struct_setter = ::std::vector<::std::int32_t>>
  [[deprecated("Use `FOO.field2() = BAR;` instead of `FOO.set_field2(BAR);`")]]
  ::std::vector<::std::int32_t>& set_field2(T_TerseFoo_field2_struct_setter&& field2_) {
    field2_ref() = std::forward<T_TerseFoo_field2_struct_setter>(field2_);
    return __fbthrift_field_field2;
  }
  /** Glean { "field": "field3" } */
  const ::std::vector<double>& get_field3() const&;
  /** Glean { "field": "field3" } */
  ::std::vector<double> get_field3() &&;

  /** Glean { "field": "field3" } */
  template <typename T_TerseFoo_field3_struct_setter = ::std::vector<double>>
  [[deprecated("Use `FOO.field3() = BAR;` instead of `FOO.set_field3(BAR);`")]]
  ::std::vector<double>& set_field3(T_TerseFoo_field3_struct_setter&& field3_) {
    field3_ref() = std::forward<T_TerseFoo_field3_struct_setter>(field3_);
    return __fbthrift_field_field3;
  }
  /** Glean { "field": "field4" } */
  const ::std::vector<::std::int32_t>& get_field4() const&;
  /** Glean { "field": "field4" } */
  ::std::vector<::std::int32_t> get_field4() &&;

  /** Glean { "field": "field4" } */
  template <typename T_TerseFoo_field4_struct_setter = ::std::vector<::std::int32_t>>
  [[deprecated("Use `FOO.field4() = BAR;` instead of `FOO.set_field4(BAR);`")]]
  ::std::vector<::std::int32_t>& set_field4(T_TerseFoo_field4_struct_setter&& field4_) {
    field4_ref() = std::forward<T_TerseFoo_field4_struct_setter>(field4_);
    return __fbthrift_field_field4;
  }

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

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

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

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


/** Glean {"file": "thrift/compiler/test/fixtures/lazy_deserialization/src/deprecated_terse_writes.thrift", "name": "TerseLazyFoo", "kind": "struct" } */
class TerseLazyFoo final  {
 private:
  friend struct ::apache::thrift::detail::st::struct_private_access;
  template<class> friend struct ::apache::thrift::detail::invoke_reffer;

  //  used by a static_assert in the corresponding source
  static constexpr bool __fbthrift_cpp2_gen_json = false;
  static constexpr bool __fbthrift_cpp2_is_runtime_annotation = false;
  static std::string_view __fbthrift_get_field_name(::apache::thrift::FieldOrdinal ord);
  static std::string_view __fbthrift_get_class_name();
  using __fbthrift_reflection_ident_list = folly::tag_t<
    ::apache::thrift::ident::field1,
    ::apache::thrift::ident::field2,
    ::apache::thrift::ident::field3,
    ::apache::thrift::ident::field4
  >;

  static constexpr std::int16_t __fbthrift_reflection_field_id_list[] = {0,1,2,3,4};
  using __fbthrift_reflection_type_tags = folly::tag_t<
    ::apache::thrift::type::list<::apache::thrift::type::double_t>,
    ::apache::thrift::type::list<::apache::thrift::type::i32_t>,
    ::apache::thrift::type::list<::apache::thrift::type::double_t>,
    ::apache::thrift::type::list<::apache::thrift::type::i32_t>
  >;

  static constexpr std::size_t __fbthrift_field_size_v = 4;

  template<class T>
  using __fbthrift_id = ::apache::thrift::type::field_id<__fbthrift_reflection_field_id_list[folly::to_underlying(T::value)]>;

  template<class T>
  using __fbthrift_type_tag = ::apache::thrift::detail::at<__fbthrift_reflection_type_tags, T::value>;

  template<class T>
  using __fbthrift_ident = ::apache::thrift::detail::at<__fbthrift_reflection_ident_list, T::value>;

  template<class T> using __fbthrift_ordinal = ::apache::thrift::type::ordinal_tag<
    ::apache::thrift::detail::getFieldOrdinal<T,
                                              __fbthrift_reflection_ident_list,
                                              __fbthrift_reflection_type_tags>(
      __fbthrift_reflection_field_id_list
    )
  >;
  void __fbthrift_clear();
  void __fbthrift_clear_terse_fields();
  bool __fbthrift_is_empty() const;

 public:
  using __fbthrift_cpp2_type = TerseLazyFoo;
  static constexpr bool __fbthrift_cpp2_is_union =
    false;
  static constexpr bool __fbthrift_cpp2_uses_op_encode =
    false;


 public:

  TerseLazyFoo();

  // FragileConstructor for use in initialization lists only.
  [[deprecated("This constructor is deprecated")]]
  TerseLazyFoo(apache::thrift::FragileConstructor, ::std::vector<double> field1__arg, ::std::vector<::std::int32_t> field2__arg, ::std::vector<double> field3__arg, ::std::vector<::std::int32_t> field4__arg);

  TerseLazyFoo(TerseLazyFoo&&) noexcept;
  TerseLazyFoo(const TerseLazyFoo& src);


  TerseLazyFoo& operator=(TerseLazyFoo&&) noexcept;
  TerseLazyFoo& operator=(const TerseLazyFoo& src);

  ~TerseLazyFoo();

 private:
  ::std::vector<double> __fbthrift_field_field1;
 private:
  ::std::vector<::std::int32_t> __fbthrift_field_field2;
 private:
  mutable ::std::vector<double> __fbthrift_field_field3;
 private:
  mutable ::std::vector<::std::int32_t> __fbthrift_field_field4;
 private:
  apache::thrift::detail::isset_bitset<4, apache::thrift::detail::IssetBitsetOption::Unpacked> __isset;

 public:

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

  /** Glean { "field": "field1" } */
  template <typename..., typename T = ::std::vector<double>>
  FOLLY_ERASE ::apache::thrift::field_ref<const T&> field1_ref() const& {
    return {this->__fbthrift_field_field1, __isset.at(0), __isset.bit(0)};
  }

  /** Glean { "field": "field1" } */
  template <typename..., typename T = ::std::vector<double>>
  FOLLY_ERASE ::apache::thrift::field_ref<const T&&> field1_ref() const&& {
    return {static_cast<const T&&>(this->__fbthrift_field_field1), __isset.at(0), __isset.bit(0)};
  }

  /** Glean { "field": "field1" } */
  template <typename..., typename T = ::std::vector<double>>
  FOLLY_ERASE ::apache::thrift::field_ref<T&> field1_ref() & {
    return {this->__fbthrift_field_field1, __isset.at(0), __isset.bit(0)};
  }

  /** Glean { "field": "field1" } */
  template <typename..., typename T = ::std::vector<double>>
  FOLLY_ERASE ::apache::thrift::field_ref<T&&> field1_ref() && {
    return {static_cast<T&&>(this->__fbthrift_field_field1), __isset.at(0), __isset.bit(0)};
  }

  /** Glean { "field": "field1" } */
  template <typename..., typename T = ::std::vector<double>>
  FOLLY_ERASE ::apache::thrift::field_ref<const T&> field1() const& {
    return {this->__fbthrift_field_field1, __isset.at(0), __isset.bit(0)};
  }

  /** Glean { "field": "field1" } */
  template <typename..., typename T = ::std::vector<double>>
  FOLLY_ERASE ::apache::thrift::field_ref<const T&&> field1() const&& {
    return {static_cast<const T&&>(this->__fbthrift_field_field1), __isset.at(0), __isset.bit(0)};
  }

  /** Glean { "field": "field1" } */
  template <typename..., typename T = ::std::vector<double>>
  FOLLY_ERASE ::apache::thrift::field_ref<T&> field1() & {
    return {this->__fbthrift_field_field1, __isset.at(0), __isset.bit(0)};
  }

  /** Glean { "field": "field1" } */
  template <typename..., typename T = ::std::vector<double>>
  FOLLY_ERASE ::apache::thrift::field_ref<T&&> field1() && {
    return {static_cast<T&&>(this->__fbthrift_field_field1), __isset.at(0), __isset.bit(0)};
  }

  /** Glean { "field": "field2" } */
  template <typename..., typename T = ::std::vector<::std::int32_t>>
  FOLLY_ERASE ::apache::thrift::field_ref<const T&> field2_ref() const& {
    return {this->__fbthrift_field_field2, __isset.at(1), __isset.bit(1)};
  }

  /** Glean { "field": "field2" } */
  template <typename..., typename T = ::std::vector<::std::int32_t>>
  FOLLY_ERASE ::apache::thrift::field_ref<const T&&> field2_ref() const&& {
    return {static_cast<const T&&>(this->__fbthrift_field_field2), __isset.at(1), __isset.bit(1)};
  }

  /** Glean { "field": "field2" } */
  template <typename..., typename T = ::std::vector<::std::int32_t>>
  FOLLY_ERASE ::apache::thrift::field_ref<T&> field2_ref() & {
    return {this->__fbthrift_field_field2, __isset.at(1), __isset.bit(1)};
  }

  /** Glean { "field": "field2" } */
  template <typename..., typename T = ::std::vector<::std::int32_t>>
  FOLLY_ERASE ::apache::thrift::field_ref<T&&> field2_ref() && {
    return {static_cast<T&&>(this->__fbthrift_field_field2), __isset.at(1), __isset.bit(1)};
  }

  /** Glean { "field": "field2" } */
  template <typename..., typename T = ::std::vector<::std::int32_t>>
  FOLLY_ERASE ::apache::thrift::field_ref<const T&> field2() const& {
    return {this->__fbthrift_field_field2, __isset.at(1), __isset.bit(1)};
  }

  /** Glean { "field": "field2" } */
  template <typename..., typename T = ::std::vector<::std::int32_t>>
  FOLLY_ERASE ::apache::thrift::field_ref<const T&&> field2() const&& {
    return {static_cast<const T&&>(this->__fbthrift_field_field2), __isset.at(1), __isset.bit(1)};
  }

  /** Glean { "field": "field2" } */
  template <typename..., typename T = ::std::vector<::std::int32_t>>
  FOLLY_ERASE ::apache::thrift::field_ref<T&> field2() & {
    return {this->__fbthrift_field_field2, __isset.at(1), __isset.bit(1)};
  }

  /** Glean { "field": "field2" } */
  template <typename..., typename T = ::std::vector<::std::int32_t>>
  FOLLY_ERASE ::apache::thrift::field_ref<T&&> field2() && {
    return {static_cast<T&&>(this->__fbthrift_field_field2), __isset.at(1), __isset.bit(1)};
  }

  /** Glean { "field": "field3" } */
  template <typename..., typename T = ::std::vector<double>>
  FOLLY_ERASE ::apache::thrift::field_ref<const T&> field3_ref() const& {
    return {this->__fbthrift_read_field_field3(), __isset.at(2), __isset.bit(2)};
  }

  /** Glean { "field": "field3" } */
  template <typename..., typename T = ::std::vector<double>>
  FOLLY_ERASE ::apache::thrift::field_ref<const T&&> field3_ref() const&& {
    return {static_cast<const T&&>(this->__fbthrift_read_field_field3()), __isset.at(2), __isset.bit(2)};
  }

  /** Glean { "field": "field3" } */
  template <typename..., typename T = ::std::vector<double>>
  FOLLY_ERASE ::apache::thrift::field_ref<T&> field3_ref() & {
    return {this->__fbthrift_read_field_field3(), __isset.at(2), __isset.bit(2)};
  }

  /** Glean { "field": "field3" } */
  template <typename..., typename T = ::std::vector<double>>
  FOLLY_ERASE ::apache::thrift::field_ref<T&&> field3_ref() && {
    return {static_cast<T&&>(this->__fbthrift_read_field_field3()), __isset.at(2), __isset.bit(2)};
  }

  /** Glean { "field": "field3" } */
  template <typename..., typename T = ::std::vector<double>>
  FOLLY_ERASE ::apache::thrift::field_ref<const T&> field3() const& {
    return {this->__fbthrift_read_field_field3(), __isset.at(2), __isset.bit(2)};
  }

  /** Glean { "field": "field3" } */
  template <typename..., typename T = ::std::vector<double>>
  FOLLY_ERASE ::apache::thrift::field_ref<const T&&> field3() const&& {
    return {static_cast<const T&&>(this->__fbthrift_read_field_field3()), __isset.at(2), __isset.bit(2)};
  }

  /** Glean { "field": "field3" } */
  template <typename..., typename T = ::std::vector<double>>
  FOLLY_ERASE ::apache::thrift::field_ref<T&> field3() & {
    return {this->__fbthrift_read_field_field3(), __isset.at(2), __isset.bit(2)};
  }

  /** Glean { "field": "field3" } */
  template <typename..., typename T = ::std::vector<double>>
  FOLLY_ERASE ::apache::thrift::field_ref<T&&> field3() && {
    return {static_cast<T&&>(this->__fbthrift_read_field_field3()), __isset.at(2), __isset.bit(2)};
  }

  /** Glean { "field": "field4" } */
  template <typename..., typename T = ::std::vector<::std::int32_t>>
  FOLLY_ERASE ::apache::thrift::field_ref<const T&> field4_ref() const& {
    return {this->__fbthrift_read_field_field4(), __isset.at(3), __isset.bit(3)};
  }

  /** Glean { "field": "field4" } */
  template <typename..., typename T = ::std::vector<::std::int32_t>>
  FOLLY_ERASE ::apache::thrift::field_ref<const T&&> field4_ref() const&& {
    return {static_cast<const T&&>(this->__fbthrift_read_field_field4()), __isset.at(3), __isset.bit(3)};
  }

  /** Glean { "field": "field4" } */
  template <typename..., typename T = ::std::vector<::std::int32_t>>
  FOLLY_ERASE ::apache::thrift::field_ref<T&> field4_ref() & {
    return {this->__fbthrift_read_field_field4(), __isset.at(3), __isset.bit(3)};
  }

  /** Glean { "field": "field4" } */
  template <typename..., typename T = ::std::vector<::std::int32_t>>
  FOLLY_ERASE ::apache::thrift::field_ref<T&&> field4_ref() && {
    return {static_cast<T&&>(this->__fbthrift_read_field_field4()), __isset.at(3), __isset.bit(3)};
  }

  /** Glean { "field": "field4" } */
  template <typename..., typename T = ::std::vector<::std::int32_t>>
  FOLLY_ERASE ::apache::thrift::field_ref<const T&> field4() const& {
    return {this->__fbthrift_read_field_field4(), __isset.at(3), __isset.bit(3)};
  }

  /** Glean { "field": "field4" } */
  template <typename..., typename T = ::std::vector<::std::int32_t>>
  FOLLY_ERASE ::apache::thrift::field_ref<const T&&> field4() const&& {
    return {static_cast<const T&&>(this->__fbthrift_read_field_field4()), __isset.at(3), __isset.bit(3)};
  }

  /** Glean { "field": "field4" } */
  template <typename..., typename T = ::std::vector<::std::int32_t>>
  FOLLY_ERASE ::apache::thrift::field_ref<T&> field4() & {
    return {this->__fbthrift_read_field_field4(), __isset.at(3), __isset.bit(3)};
  }

  /** Glean { "field": "field4" } */
  template <typename..., typename T = ::std::vector<::std::int32_t>>
  FOLLY_ERASE ::apache::thrift::field_ref<T&&> field4() && {
    return {static_cast<T&&>(this->__fbthrift_read_field_field4()), __isset.at(3), __isset.bit(3)};
  }
  /** Glean { "field": "field1" } */
  const ::std::vector<double>& get_field1() const&;
  /** Glean { "field": "field1" } */
  ::std::vector<double> get_field1() &&;

  /** Glean { "field": "field1" } */
  template <typename T_TerseLazyFoo_field1_struct_setter = ::std::vector<double>>
  [[deprecated("Use `FOO.field1() = BAR;` instead of `FOO.set_field1(BAR);`")]]
  ::std::vector<double>& set_field1(T_TerseLazyFoo_field1_struct_setter&& field1_) {
    field1_ref() = std::forward<T_TerseLazyFoo_field1_struct_setter>(field1_);
    return __fbthrift_field_field1;
  }
  /** Glean { "field": "field2" } */
  const ::std::vector<::std::int32_t>& get_field2() const&;
  /** Glean { "field": "field2" } */
  ::std::vector<::std::int32_t> get_field2() &&;

  /** Glean { "field": "field2" } */
  template <typename T_TerseLazyFoo_field2_struct_setter = ::std::vector<::std::int32_t>>
  [[deprecated("Use `FOO.field2() = BAR;` instead of `FOO.set_field2(BAR);`")]]
  ::std::vector<::std::int32_t>& set_field2(T_TerseLazyFoo_field2_struct_setter&& field2_) {
    field2_ref() = std::forward<T_TerseLazyFoo_field2_struct_setter>(field2_);
    return __fbthrift_field_field2;
  }

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

 private:
 private:
  mutable struct __fbthrift_SerializedData {
    folly::IOBuf field3;
    folly::IOBuf field4;
  } __fbthrift_serializedData_;

  mutable ::apache::thrift::detail::st::DeserializationMutex __fbthrift_deserializationMutex_;
  ::apache::thrift::ProtocolType __fbthrift_protocol_{};

  mutable struct __fbthrift_IsDeserialized {
    std::atomic<uint8_t> field3{::apache::thrift::detail::LazyDeserializationState::UNTAINTED | ::apache::thrift::detail::LazyDeserializationState::DESERIALIZED};
    std::atomic<uint8_t> field4{::apache::thrift::detail::LazyDeserializationState::UNTAINTED | ::apache::thrift::detail::LazyDeserializationState::DESERIALIZED};
  } __fbthrift_isDeserialized_;

  const ::std::vector<double>& __fbthrift_read_field_field3() const;
  ::std::vector<double>& __fbthrift_read_field_field3();
  void __fbthrift_read_field_field3_slow() const;
  template<class ProtocolReader> void __fbthrift_read_field_field3_impl() const;
  const ::std::vector<::std::int32_t>& __fbthrift_read_field_field4() const;
  ::std::vector<::std::int32_t>& __fbthrift_read_field_field4();
  void __fbthrift_read_field_field4_slow() const;
  template<class ProtocolReader> void __fbthrift_read_field_field4_impl() const;

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

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

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


/** Glean {"file": "thrift/compiler/test/fixtures/lazy_deserialization/src/deprecated_terse_writes.thrift", "name": "TerseOptionalFoo", "kind": "struct" } */
class TerseOptionalFoo final  {
 private:
  friend struct ::apache::thrift::detail::st::struct_private_access;
  template<class> friend struct ::apache::thrift::detail::invoke_reffer;

  //  used by a static_assert in the corresponding source
  static constexpr bool __fbthrift_cpp2_gen_json = false;
  static constexpr bool __fbthrift_cpp2_is_runtime_annotation = false;
  static std::string_view __fbthrift_get_field_name(::apache::thrift::FieldOrdinal ord);
  static std::string_view __fbthrift_get_class_name();
  using __fbthrift_reflection_ident_list = folly::tag_t<
    ::apache::thrift::ident::field1,
    ::apache::thrift::ident::field2,
    ::apache::thrift::ident::field3,
    ::apache::thrift::ident::field4
  >;

  static constexpr std::int16_t __fbthrift_reflection_field_id_list[] = {0,1,2,3,4};
  using __fbthrift_reflection_type_tags = folly::tag_t<
    ::apache::thrift::type::list<::apache::thrift::type::double_t>,
    ::apache::thrift::type::list<::apache::thrift::type::i32_t>,
    ::apache::thrift::type::list<::apache::thrift::type::double_t>,
    ::apache::thrift::type::list<::apache::thrift::type::i32_t>
  >;

  static constexpr std::size_t __fbthrift_field_size_v = 4;

  template<class T>
  using __fbthrift_id = ::apache::thrift::type::field_id<__fbthrift_reflection_field_id_list[folly::to_underlying(T::value)]>;

  template<class T>
  using __fbthrift_type_tag = ::apache::thrift::detail::at<__fbthrift_reflection_type_tags, T::value>;

  template<class T>
  using __fbthrift_ident = ::apache::thrift::detail::at<__fbthrift_reflection_ident_list, T::value>;

  template<class T> using __fbthrift_ordinal = ::apache::thrift::type::ordinal_tag<
    ::apache::thrift::detail::getFieldOrdinal<T,
                                              __fbthrift_reflection_ident_list,
                                              __fbthrift_reflection_type_tags>(
      __fbthrift_reflection_field_id_list
    )
  >;
  void __fbthrift_clear();
  void __fbthrift_clear_terse_fields();
  bool __fbthrift_is_empty() const;

 public:
  using __fbthrift_cpp2_type = TerseOptionalFoo;
  static constexpr bool __fbthrift_cpp2_is_union =
    false;
  static constexpr bool __fbthrift_cpp2_uses_op_encode =
    false;


 public:

  TerseOptionalFoo();

  // FragileConstructor for use in initialization lists only.
  [[deprecated("This constructor is deprecated")]]
  TerseOptionalFoo(apache::thrift::FragileConstructor, ::std::vector<double> field1__arg, ::std::vector<::std::int32_t> field2__arg, ::std::vector<double> field3__arg, ::std::vector<::std::int32_t> field4__arg);

  TerseOptionalFoo(TerseOptionalFoo&&) noexcept;

  TerseOptionalFoo(const TerseOptionalFoo& src);


  TerseOptionalFoo& operator=(TerseOptionalFoo&&) noexcept;
  TerseOptionalFoo& operator=(const TerseOptionalFoo& src);

  ~TerseOptionalFoo();

 private:
  ::std::vector<double> __fbthrift_field_field1;
 private:
  ::std::vector<::std::int32_t> __fbthrift_field_field2;
 private:
  ::std::vector<double> __fbthrift_field_field3;
 private:
  ::std::vector<::std::int32_t> __fbthrift_field_field4;
 private:
  apache::thrift::detail::isset_bitset<4, apache::thrift::detail::IssetBitsetOption::Unpacked> __isset;

 public:

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

  /** Glean { "field": "field1" } */
  template <typename..., typename T = ::std::vector<double>>
  FOLLY_ERASE ::apache::thrift::optional_field_ref<const T&> field1_ref() const& {
    return {this->__fbthrift_field_field1, __isset.at(0), __isset.bit(0)};
  }

  /** Glean { "field": "field1" } */
  template <typename..., typename T = ::std::vector<double>>
  FOLLY_ERASE ::apache::thrift::optional_field_ref<const T&&> field1_ref() const&& {
    return {static_cast<const T&&>(this->__fbthrift_field_field1), __isset.at(0), __isset.bit(0)};
  }

  /** Glean { "field": "field1" } */
  template <typename..., typename T = ::std::vector<double>>
  FOLLY_ERASE ::apache::thrift::optional_field_ref<T&> field1_ref() & {
    return {this->__fbthrift_field_field1, __isset.at(0), __isset.bit(0)};
  }

  /** Glean { "field": "field1" } */
  template <typename..., typename T = ::std::vector<double>>
  FOLLY_ERASE ::apache::thrift::optional_field_ref<T&&> field1_ref() && {
    return {static_cast<T&&>(this->__fbthrift_field_field1), __isset.at(0), __isset.bit(0)};
  }

  /** Glean { "field": "field1" } */
  template <typename..., typename T = ::std::vector<double>>
  FOLLY_ERASE ::apache::thrift::optional_field_ref<const T&> field1() const& {
    return {this->__fbthrift_field_field1, __isset.at(0), __isset.bit(0)};
  }

  /** Glean { "field": "field1" } */
  template <typename..., typename T = ::std::vector<double>>
  FOLLY_ERASE ::apache::thrift::optional_field_ref<const T&&> field1() const&& {
    return {static_cast<const T&&>(this->__fbthrift_field_field1), __isset.at(0), __isset.bit(0)};
  }

  /** Glean { "field": "field1" } */
  template <typename..., typename T = ::std::vector<double>>
  FOLLY_ERASE ::apache::thrift::optional_field_ref<T&> field1() & {
    return {this->__fbthrift_field_field1, __isset.at(0), __isset.bit(0)};
  }

  /** Glean { "field": "field1" } */
  template <typename..., typename T = ::std::vector<double>>
  FOLLY_ERASE ::apache::thrift::optional_field_ref<T&&> field1() && {
    return {static_cast<T&&>(this->__fbthrift_field_field1), __isset.at(0), __isset.bit(0)};
  }

  /** Glean { "field": "field2" } */
  template <typename..., typename T = ::std::vector<::std::int32_t>>
  FOLLY_ERASE ::apache::thrift::optional_field_ref<const T&> field2_ref() const& {
    return {this->__fbthrift_field_field2, __isset.at(1), __isset.bit(1)};
  }

  /** Glean { "field": "field2" } */
  template <typename..., typename T = ::std::vector<::std::int32_t>>
  FOLLY_ERASE ::apache::thrift::optional_field_ref<const T&&> field2_ref() const&& {
    return {static_cast<const T&&>(this->__fbthrift_field_field2), __isset.at(1), __isset.bit(1)};
  }

  /** Glean { "field": "field2" } */
  template <typename..., typename T = ::std::vector<::std::int32_t>>
  FOLLY_ERASE ::apache::thrift::optional_field_ref<T&> field2_ref() & {
    return {this->__fbthrift_field_field2, __isset.at(1), __isset.bit(1)};
  }

  /** Glean { "field": "field2" } */
  template <typename..., typename T = ::std::vector<::std::int32_t>>
  FOLLY_ERASE ::apache::thrift::optional_field_ref<T&&> field2_ref() && {
    return {static_cast<T&&>(this->__fbthrift_field_field2), __isset.at(1), __isset.bit(1)};
  }

  /** Glean { "field": "field2" } */
  template <typename..., typename T = ::std::vector<::std::int32_t>>
  FOLLY_ERASE ::apache::thrift::optional_field_ref<const T&> field2() const& {
    return {this->__fbthrift_field_field2, __isset.at(1), __isset.bit(1)};
  }

  /** Glean { "field": "field2" } */
  template <typename..., typename T = ::std::vector<::std::int32_t>>
  FOLLY_ERASE ::apache::thrift::optional_field_ref<const T&&> field2() const&& {
    return {static_cast<const T&&>(this->__fbthrift_field_field2), __isset.at(1), __isset.bit(1)};
  }

  /** Glean { "field": "field2" } */
  template <typename..., typename T = ::std::vector<::std::int32_t>>
  FOLLY_ERASE ::apache::thrift::optional_field_ref<T&> field2() & {
    return {this->__fbthrift_field_field2, __isset.at(1), __isset.bit(1)};
  }

  /** Glean { "field": "field2" } */
  template <typename..., typename T = ::std::vector<::std::int32_t>>
  FOLLY_ERASE ::apache::thrift::optional_field_ref<T&&> field2() && {
    return {static_cast<T&&>(this->__fbthrift_field_field2), __isset.at(1), __isset.bit(1)};
  }

  /** Glean { "field": "field3" } */
  template <typename..., typename T = ::std::vector<double>>
  FOLLY_ERASE ::apache::thrift::optional_field_ref<const T&> field3_ref() const& {
    return {this->__fbthrift_field_field3, __isset.at(2), __isset.bit(2)};
  }

  /** Glean { "field": "field3" } */
  template <typename..., typename T = ::std::vector<double>>
  FOLLY_ERASE ::apache::thrift::optional_field_ref<const T&&> field3_ref() const&& {
    return {static_cast<const T&&>(this->__fbthrift_field_field3), __isset.at(2), __isset.bit(2)};
  }

  /** Glean { "field": "field3" } */
  template <typename..., typename T = ::std::vector<double>>
  FOLLY_ERASE ::apache::thrift::optional_field_ref<T&> field3_ref() & {
    return {this->__fbthrift_field_field3, __isset.at(2), __isset.bit(2)};
  }

  /** Glean { "field": "field3" } */
  template <typename..., typename T = ::std::vector<double>>
  FOLLY_ERASE ::apache::thrift::optional_field_ref<T&&> field3_ref() && {
    return {static_cast<T&&>(this->__fbthrift_field_field3), __isset.at(2), __isset.bit(2)};
  }

  /** Glean { "field": "field3" } */
  template <typename..., typename T = ::std::vector<double>>
  FOLLY_ERASE ::apache::thrift::optional_field_ref<const T&> field3() const& {
    return {this->__fbthrift_field_field3, __isset.at(2), __isset.bit(2)};
  }

  /** Glean { "field": "field3" } */
  template <typename..., typename T = ::std::vector<double>>
  FOLLY_ERASE ::apache::thrift::optional_field_ref<const T&&> field3() const&& {
    return {static_cast<const T&&>(this->__fbthrift_field_field3), __isset.at(2), __isset.bit(2)};
  }

  /** Glean { "field": "field3" } */
  template <typename..., typename T = ::std::vector<double>>
  FOLLY_ERASE ::apache::thrift::optional_field_ref<T&> field3() & {
    return {this->__fbthrift_field_field3, __isset.at(2), __isset.bit(2)};
  }

  /** Glean { "field": "field3" } */
  template <typename..., typename T = ::std::vector<double>>
  FOLLY_ERASE ::apache::thrift::optional_field_ref<T&&> field3() && {
    return {static_cast<T&&>(this->__fbthrift_field_field3), __isset.at(2), __isset.bit(2)};
  }

  /** Glean { "field": "field4" } */
  template <typename..., typename T = ::std::vector<::std::int32_t>>
  FOLLY_ERASE ::apache::thrift::optional_field_ref<const T&> field4_ref() const& {
    return {this->__fbthrift_field_field4, __isset.at(3), __isset.bit(3)};
  }

  /** Glean { "field": "field4" } */
  template <typename..., typename T = ::std::vector<::std::int32_t>>
  FOLLY_ERASE ::apache::thrift::optional_field_ref<const T&&> field4_ref() const&& {
    return {static_cast<const T&&>(this->__fbthrift_field_field4), __isset.at(3), __isset.bit(3)};
  }

  /** Glean { "field": "field4" } */
  template <typename..., typename T = ::std::vector<::std::int32_t>>
  FOLLY_ERASE ::apache::thrift::optional_field_ref<T&> field4_ref() & {
    return {this->__fbthrift_field_field4, __isset.at(3), __isset.bit(3)};
  }

  /** Glean { "field": "field4" } */
  template <typename..., typename T = ::std::vector<::std::int32_t>>
  FOLLY_ERASE ::apache::thrift::optional_field_ref<T&&> field4_ref() && {
    return {static_cast<T&&>(this->__fbthrift_field_field4), __isset.at(3), __isset.bit(3)};
  }

  /** Glean { "field": "field4" } */
  template <typename..., typename T = ::std::vector<::std::int32_t>>
  FOLLY_ERASE ::apache::thrift::optional_field_ref<const T&> field4() const& {
    return {this->__fbthrift_field_field4, __isset.at(3), __isset.bit(3)};
  }

  /** Glean { "field": "field4" } */
  template <typename..., typename T = ::std::vector<::std::int32_t>>
  FOLLY_ERASE ::apache::thrift::optional_field_ref<const T&&> field4() const&& {
    return {static_cast<const T&&>(this->__fbthrift_field_field4), __isset.at(3), __isset.bit(3)};
  }

  /** Glean { "field": "field4" } */
  template <typename..., typename T = ::std::vector<::std::int32_t>>
  FOLLY_ERASE ::apache::thrift::optional_field_ref<T&> field4() & {
    return {this->__fbthrift_field_field4, __isset.at(3), __isset.bit(3)};
  }

  /** Glean { "field": "field4" } */
  template <typename..., typename T = ::std::vector<::std::int32_t>>
  FOLLY_ERASE ::apache::thrift::optional_field_ref<T&&> field4() && {
    return {static_cast<T&&>(this->__fbthrift_field_field4), __isset.at(3), __isset.bit(3)};
  }
  /** Glean { "field": "field1" } */
  const ::std::vector<double>* get_field1() const&;
  /** Glean { "field": "field1" } */
  ::std::vector<double>* get_field1() &;
  /** Glean { "field": "field1" } */
  ::std::vector<double>* get_field1() && = delete;

  /** Glean { "field": "field1" } */
  template <typename T_TerseOptionalFoo_field1_struct_setter = ::std::vector<double>>
  [[deprecated("Use `FOO.field1() = BAR;` instead of `FOO.set_field1(BAR);`")]]
  ::std::vector<double>& set_field1(T_TerseOptionalFoo_field1_struct_setter&& field1_) {
    field1_ref() = std::forward<T_TerseOptionalFoo_field1_struct_setter>(field1_);
    return __fbthrift_field_field1;
  }
  /** Glean { "field": "field2" } */
  const ::std::vector<::std::int32_t>* get_field2() const&;
  /** Glean { "field": "field2" } */
  ::std::vector<::std::int32_t>* get_field2() &;
  /** Glean { "field": "field2" } */
  ::std::vector<::std::int32_t>* get_field2() && = delete;

  /** Glean { "field": "field2" } */
  template <typename T_TerseOptionalFoo_field2_struct_setter = ::std::vector<::std::int32_t>>
  [[deprecated("Use `FOO.field2() = BAR;` instead of `FOO.set_field2(BAR);`")]]
  ::std::vector<::std::int32_t>& set_field2(T_TerseOptionalFoo_field2_struct_setter&& field2_) {
    field2_ref() = std::forward<T_TerseOptionalFoo_field2_struct_setter>(field2_);
    return __fbthrift_field_field2;
  }
  /** Glean { "field": "field3" } */
  const ::std::vector<double>* get_field3() const&;
  /** Glean { "field": "field3" } */
  ::std::vector<double>* get_field3() &;
  /** Glean { "field": "field3" } */
  ::std::vector<double>* get_field3() && = delete;

  /** Glean { "field": "field3" } */
  template <typename T_TerseOptionalFoo_field3_struct_setter = ::std::vector<double>>
  [[deprecated("Use `FOO.field3() = BAR;` instead of `FOO.set_field3(BAR);`")]]
  ::std::vector<double>& set_field3(T_TerseOptionalFoo_field3_struct_setter&& field3_) {
    field3_ref() = std::forward<T_TerseOptionalFoo_field3_struct_setter>(field3_);
    return __fbthrift_field_field3;
  }
  /** Glean { "field": "field4" } */
  const ::std::vector<::std::int32_t>* get_field4() const&;
  /** Glean { "field": "field4" } */
  ::std::vector<::std::int32_t>* get_field4() &;
  /** Glean { "field": "field4" } */
  ::std::vector<::std::int32_t>* get_field4() && = delete;

  /** Glean { "field": "field4" } */
  template <typename T_TerseOptionalFoo_field4_struct_setter = ::std::vector<::std::int32_t>>
  [[deprecated("Use `FOO.field4() = BAR;` instead of `FOO.set_field4(BAR);`")]]
  ::std::vector<::std::int32_t>& set_field4(T_TerseOptionalFoo_field4_struct_setter&& field4_) {
    field4_ref() = std::forward<T_TerseOptionalFoo_field4_struct_setter>(field4_);
    return __fbthrift_field_field4;
  }

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

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

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

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


/** Glean {"file": "thrift/compiler/test/fixtures/lazy_deserialization/src/deprecated_terse_writes.thrift", "name": "TerseOptionalLazyFoo", "kind": "struct" } */
class TerseOptionalLazyFoo final  {
 private:
  friend struct ::apache::thrift::detail::st::struct_private_access;
  template<class> friend struct ::apache::thrift::detail::invoke_reffer;

  //  used by a static_assert in the corresponding source
  static constexpr bool __fbthrift_cpp2_gen_json = false;
  static constexpr bool __fbthrift_cpp2_is_runtime_annotation = false;
  static std::string_view __fbthrift_get_field_name(::apache::thrift::FieldOrdinal ord);
  static std::string_view __fbthrift_get_class_name();
  using __fbthrift_reflection_ident_list = folly::tag_t<
    ::apache::thrift::ident::field1,
    ::apache::thrift::ident::field2,
    ::apache::thrift::ident::field3,
    ::apache::thrift::ident::field4
  >;

  static constexpr std::int16_t __fbthrift_reflection_field_id_list[] = {0,1,2,3,4};
  using __fbthrift_reflection_type_tags = folly::tag_t<
    ::apache::thrift::type::list<::apache::thrift::type::double_t>,
    ::apache::thrift::type::list<::apache::thrift::type::i32_t>,
    ::apache::thrift::type::list<::apache::thrift::type::double_t>,
    ::apache::thrift::type::list<::apache::thrift::type::i32_t>
  >;

  static constexpr std::size_t __fbthrift_field_size_v = 4;

  template<class T>
  using __fbthrift_id = ::apache::thrift::type::field_id<__fbthrift_reflection_field_id_list[folly::to_underlying(T::value)]>;

  template<class T>
  using __fbthrift_type_tag = ::apache::thrift::detail::at<__fbthrift_reflection_type_tags, T::value>;

  template<class T>
  using __fbthrift_ident = ::apache::thrift::detail::at<__fbthrift_reflection_ident_list, T::value>;

  template<class T> using __fbthrift_ordinal = ::apache::thrift::type::ordinal_tag<
    ::apache::thrift::detail::getFieldOrdinal<T,
                                              __fbthrift_reflection_ident_list,
                                              __fbthrift_reflection_type_tags>(
      __fbthrift_reflection_field_id_list
    )
  >;
  void __fbthrift_clear();
  void __fbthrift_clear_terse_fields();
  bool __fbthrift_is_empty() const;

 public:
  using __fbthrift_cpp2_type = TerseOptionalLazyFoo;
  static constexpr bool __fbthrift_cpp2_is_union =
    false;
  static constexpr bool __fbthrift_cpp2_uses_op_encode =
    false;


 public:

  TerseOptionalLazyFoo();

  // FragileConstructor for use in initialization lists only.
  [[deprecated("This constructor is deprecated")]]
  TerseOptionalLazyFoo(apache::thrift::FragileConstructor, ::std::vector<double> field1__arg, ::std::vector<::std::int32_t> field2__arg, ::std::vector<double> field3__arg, ::std::vector<::std::int32_t> field4__arg);

  TerseOptionalLazyFoo(TerseOptionalLazyFoo&&) noexcept;
  TerseOptionalLazyFoo(const TerseOptionalLazyFoo& src);


  TerseOptionalLazyFoo& operator=(TerseOptionalLazyFoo&&) noexcept;
  TerseOptionalLazyFoo& operator=(const TerseOptionalLazyFoo& src);

  ~TerseOptionalLazyFoo();

 private:
  ::std::vector<double> __fbthrift_field_field1;
 private:
  ::std::vector<::std::int32_t> __fbthrift_field_field2;
 private:
  mutable ::std::vector<double> __fbthrift_field_field3;
 private:
  mutable ::std::vector<::std::int32_t> __fbthrift_field_field4;
 private:
  apache::thrift::detail::isset_bitset<4, apache::thrift::detail::IssetBitsetOption::Unpacked> __isset;

 public:

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

  /** Glean { "field": "field1" } */
  template <typename..., typename T = ::std::vector<double>>
  FOLLY_ERASE ::apache::thrift::optional_field_ref<const T&> field1_ref() const& {
    return {this->__fbthrift_field_field1, __isset.at(0), __isset.bit(0)};
  }

  /** Glean { "field": "field1" } */
  template <typename..., typename T = ::std::vector<double>>
  FOLLY_ERASE ::apache::thrift::optional_field_ref<const T&&> field1_ref() const&& {
    return {static_cast<const T&&>(this->__fbthrift_field_field1), __isset.at(0), __isset.bit(0)};
  }

  /** Glean { "field": "field1" } */
  template <typename..., typename T = ::std::vector<double>>
  FOLLY_ERASE ::apache::thrift::optional_field_ref<T&> field1_ref() & {
    return {this->__fbthrift_field_field1, __isset.at(0), __isset.bit(0)};
  }

  /** Glean { "field": "field1" } */
  template <typename..., typename T = ::std::vector<double>>
  FOLLY_ERASE ::apache::thrift::optional_field_ref<T&&> field1_ref() && {
    return {static_cast<T&&>(this->__fbthrift_field_field1), __isset.at(0), __isset.bit(0)};
  }

  /** Glean { "field": "field1" } */
  template <typename..., typename T = ::std::vector<double>>
  FOLLY_ERASE ::apache::thrift::optional_field_ref<const T&> field1() const& {
    return {this->__fbthrift_field_field1, __isset.at(0), __isset.bit(0)};
  }

  /** Glean { "field": "field1" } */
  template <typename..., typename T = ::std::vector<double>>
  FOLLY_ERASE ::apache::thrift::optional_field_ref<const T&&> field1() const&& {
    return {static_cast<const T&&>(this->__fbthrift_field_field1), __isset.at(0), __isset.bit(0)};
  }

  /** Glean { "field": "field1" } */
  template <typename..., typename T = ::std::vector<double>>
  FOLLY_ERASE ::apache::thrift::optional_field_ref<T&> field1() & {
    return {this->__fbthrift_field_field1, __isset.at(0), __isset.bit(0)};
  }

  /** Glean { "field": "field1" } */
  template <typename..., typename T = ::std::vector<double>>
  FOLLY_ERASE ::apache::thrift::optional_field_ref<T&&> field1() && {
    return {static_cast<T&&>(this->__fbthrift_field_field1), __isset.at(0), __isset.bit(0)};
  }

  /** Glean { "field": "field2" } */
  template <typename..., typename T = ::std::vector<::std::int32_t>>
  FOLLY_ERASE ::apache::thrift::optional_field_ref<const T&> field2_ref() const& {
    return {this->__fbthrift_field_field2, __isset.at(1), __isset.bit(1)};
  }

  /** Glean { "field": "field2" } */
  template <typename..., typename T = ::std::vector<::std::int32_t>>
  FOLLY_ERASE ::apache::thrift::optional_field_ref<const T&&> field2_ref() const&& {
    return {static_cast<const T&&>(this->__fbthrift_field_field2), __isset.at(1), __isset.bit(1)};
  }

  /** Glean { "field": "field2" } */
  template <typename..., typename T = ::std::vector<::std::int32_t>>
  FOLLY_ERASE ::apache::thrift::optional_field_ref<T&> field2_ref() & {
    return {this->__fbthrift_field_field2, __isset.at(1), __isset.bit(1)};
  }

  /** Glean { "field": "field2" } */
  template <typename..., typename T = ::std::vector<::std::int32_t>>
  FOLLY_ERASE ::apache::thrift::optional_field_ref<T&&> field2_ref() && {
    return {static_cast<T&&>(this->__fbthrift_field_field2), __isset.at(1), __isset.bit(1)};
  }

  /** Glean { "field": "field2" } */
  template <typename..., typename T = ::std::vector<::std::int32_t>>
  FOLLY_ERASE ::apache::thrift::optional_field_ref<const T&> field2() const& {
    return {this->__fbthrift_field_field2, __isset.at(1), __isset.bit(1)};
  }

  /** Glean { "field": "field2" } */
  template <typename..., typename T = ::std::vector<::std::int32_t>>
  FOLLY_ERASE ::apache::thrift::optional_field_ref<const T&&> field2() const&& {
    return {static_cast<const T&&>(this->__fbthrift_field_field2), __isset.at(1), __isset.bit(1)};
  }

  /** Glean { "field": "field2" } */
  template <typename..., typename T = ::std::vector<::std::int32_t>>
  FOLLY_ERASE ::apache::thrift::optional_field_ref<T&> field2() & {
    return {this->__fbthrift_field_field2, __isset.at(1), __isset.bit(1)};
  }

  /** Glean { "field": "field2" } */
  template <typename..., typename T = ::std::vector<::std::int32_t>>
  FOLLY_ERASE ::apache::thrift::optional_field_ref<T&&> field2() && {
    return {static_cast<T&&>(this->__fbthrift_field_field2), __isset.at(1), __isset.bit(1)};
  }

  /** Glean { "field": "field3" } */
  template <typename..., typename T = ::std::vector<double>>
  FOLLY_ERASE ::apache::thrift::optional_field_ref<const T&> field3_ref() const& {
    return {this->__fbthrift_read_field_field3(), __isset.at(2), __isset.bit(2)};
  }

  /** Glean { "field": "field3" } */
  template <typename..., typename T = ::std::vector<double>>
  FOLLY_ERASE ::apache::thrift::optional_field_ref<const T&&> field3_ref() const&& {
    return {static_cast<const T&&>(this->__fbthrift_read_field_field3()), __isset.at(2), __isset.bit(2)};
  }

  /** Glean { "field": "field3" } */
  template <typename..., typename T = ::std::vector<double>>
  FOLLY_ERASE ::apache::thrift::optional_field_ref<T&> field3_ref() & {
    return {this->__fbthrift_read_field_field3(), __isset.at(2), __isset.bit(2)};
  }

  /** Glean { "field": "field3" } */
  template <typename..., typename T = ::std::vector<double>>
  FOLLY_ERASE ::apache::thrift::optional_field_ref<T&&> field3_ref() && {
    return {static_cast<T&&>(this->__fbthrift_read_field_field3()), __isset.at(2), __isset.bit(2)};
  }

  /** Glean { "field": "field3" } */
  template <typename..., typename T = ::std::vector<double>>
  FOLLY_ERASE ::apache::thrift::optional_field_ref<const T&> field3() const& {
    return {this->__fbthrift_read_field_field3(), __isset.at(2), __isset.bit(2)};
  }

  /** Glean { "field": "field3" } */
  template <typename..., typename T = ::std::vector<double>>
  FOLLY_ERASE ::apache::thrift::optional_field_ref<const T&&> field3() const&& {
    return {static_cast<const T&&>(this->__fbthrift_read_field_field3()), __isset.at(2), __isset.bit(2)};
  }

  /** Glean { "field": "field3" } */
  template <typename..., typename T = ::std::vector<double>>
  FOLLY_ERASE ::apache::thrift::optional_field_ref<T&> field3() & {
    return {this->__fbthrift_read_field_field3(), __isset.at(2), __isset.bit(2)};
  }

  /** Glean { "field": "field3" } */
  template <typename..., typename T = ::std::vector<double>>
  FOLLY_ERASE ::apache::thrift::optional_field_ref<T&&> field3() && {
    return {static_cast<T&&>(this->__fbthrift_read_field_field3()), __isset.at(2), __isset.bit(2)};
  }

  /** Glean { "field": "field4" } */
  template <typename..., typename T = ::std::vector<::std::int32_t>>
  FOLLY_ERASE ::apache::thrift::optional_field_ref<const T&> field4_ref() const& {
    return {this->__fbthrift_read_field_field4(), __isset.at(3), __isset.bit(3)};
  }

  /** Glean { "field": "field4" } */
  template <typename..., typename T = ::std::vector<::std::int32_t>>
  FOLLY_ERASE ::apache::thrift::optional_field_ref<const T&&> field4_ref() const&& {
    return {static_cast<const T&&>(this->__fbthrift_read_field_field4()), __isset.at(3), __isset.bit(3)};
  }

  /** Glean { "field": "field4" } */
  template <typename..., typename T = ::std::vector<::std::int32_t>>
  FOLLY_ERASE ::apache::thrift::optional_field_ref<T&> field4_ref() & {
    return {this->__fbthrift_read_field_field4(), __isset.at(3), __isset.bit(3)};
  }

  /** Glean { "field": "field4" } */
  template <typename..., typename T = ::std::vector<::std::int32_t>>
  FOLLY_ERASE ::apache::thrift::optional_field_ref<T&&> field4_ref() && {
    return {static_cast<T&&>(this->__fbthrift_read_field_field4()), __isset.at(3), __isset.bit(3)};
  }

  /** Glean { "field": "field4" } */
  template <typename..., typename T = ::std::vector<::std::int32_t>>
  FOLLY_ERASE ::apache::thrift::optional_field_ref<const T&> field4() const& {
    return {this->__fbthrift_read_field_field4(), __isset.at(3), __isset.bit(3)};
  }

  /** Glean { "field": "field4" } */
  template <typename..., typename T = ::std::vector<::std::int32_t>>
  FOLLY_ERASE ::apache::thrift::optional_field_ref<const T&&> field4() const&& {
    return {static_cast<const T&&>(this->__fbthrift_read_field_field4()), __isset.at(3), __isset.bit(3)};
  }

  /** Glean { "field": "field4" } */
  template <typename..., typename T = ::std::vector<::std::int32_t>>
  FOLLY_ERASE ::apache::thrift::optional_field_ref<T&> field4() & {
    return {this->__fbthrift_read_field_field4(), __isset.at(3), __isset.bit(3)};
  }

  /** Glean { "field": "field4" } */
  template <typename..., typename T = ::std::vector<::std::int32_t>>
  FOLLY_ERASE ::apache::thrift::optional_field_ref<T&&> field4() && {
    return {static_cast<T&&>(this->__fbthrift_read_field_field4()), __isset.at(3), __isset.bit(3)};
  }
  /** Glean { "field": "field1" } */
  const ::std::vector<double>* get_field1() const&;
  /** Glean { "field": "field1" } */
  ::std::vector<double>* get_field1() &;
  /** Glean { "field": "field1" } */
  ::std::vector<double>* get_field1() && = delete;

  /** Glean { "field": "field1" } */
  template <typename T_TerseOptionalLazyFoo_field1_struct_setter = ::std::vector<double>>
  [[deprecated("Use `FOO.field1() = BAR;` instead of `FOO.set_field1(BAR);`")]]
  ::std::vector<double>& set_field1(T_TerseOptionalLazyFoo_field1_struct_setter&& field1_) {
    field1_ref() = std::forward<T_TerseOptionalLazyFoo_field1_struct_setter>(field1_);
    return __fbthrift_field_field1;
  }
  /** Glean { "field": "field2" } */
  const ::std::vector<::std::int32_t>* get_field2() const&;
  /** Glean { "field": "field2" } */
  ::std::vector<::std::int32_t>* get_field2() &;
  /** Glean { "field": "field2" } */
  ::std::vector<::std::int32_t>* get_field2() && = delete;

  /** Glean { "field": "field2" } */
  template <typename T_TerseOptionalLazyFoo_field2_struct_setter = ::std::vector<::std::int32_t>>
  [[deprecated("Use `FOO.field2() = BAR;` instead of `FOO.set_field2(BAR);`")]]
  ::std::vector<::std::int32_t>& set_field2(T_TerseOptionalLazyFoo_field2_struct_setter&& field2_) {
    field2_ref() = std::forward<T_TerseOptionalLazyFoo_field2_struct_setter>(field2_);
    return __fbthrift_field_field2;
  }

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

 private:
 private:
  mutable struct __fbthrift_SerializedData {
    folly::IOBuf field3;
    folly::IOBuf field4;
  } __fbthrift_serializedData_;

  mutable ::apache::thrift::detail::st::DeserializationMutex __fbthrift_deserializationMutex_;
  ::apache::thrift::ProtocolType __fbthrift_protocol_{};

  mutable struct __fbthrift_IsDeserialized {
    std::atomic<uint8_t> field3{::apache::thrift::detail::LazyDeserializationState::UNTAINTED | ::apache::thrift::detail::LazyDeserializationState::DESERIALIZED};
    std::atomic<uint8_t> field4{::apache::thrift::detail::LazyDeserializationState::UNTAINTED | ::apache::thrift::detail::LazyDeserializationState::DESERIALIZED};
  } __fbthrift_isDeserialized_;

  const ::std::vector<double>& __fbthrift_read_field_field3() const;
  ::std::vector<double>& __fbthrift_read_field_field3();
  void __fbthrift_read_field_field3_slow() const;
  template<class ProtocolReader> void __fbthrift_read_field_field3_impl() const;
  const ::std::vector<::std::int32_t>& __fbthrift_read_field_field4() const;
  ::std::vector<::std::int32_t>& __fbthrift_read_field_field4();
  void __fbthrift_read_field_field4_slow() const;
  template<class ProtocolReader> void __fbthrift_read_field_field4_impl() const;

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

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

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


} // namespace apache::thrift::test
