text: /**
   * Autogenerated by Thrift for src/terse_writes.thrift
   *
   * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
   *  @generated @nocommit
   */
  #pragma once
  
  #include "thrift/compiler/test/fixtures/lazy_deserialization/gen-cpp2/terse_writes_types.h"
  
  #include <thrift/lib/cpp2/gen/module_types_tcc.h>
  
  
  namespace apache {
  namespace thrift {
  namespace detail {
  
  template <>
  struct TccStructTraits<::apache::thrift::test::TerseFoo> {
    static void translateFieldName(
        folly::StringPiece _fname,
        int16_t& fid,
        apache::thrift::protocol::TType& _ftype) noexcept;
  };
  template <>
  struct TccStructTraits<::apache::thrift::test::TerseLazyFoo> {
    static void translateFieldName(
        folly::StringPiece _fname,
        int16_t& fid,
        apache::thrift::protocol::TType& _ftype) noexcept;
  };
  template <>
  struct TccStructTraits<::apache::thrift::test::TerseOptionalFoo> {
    static void translateFieldName(
        folly::StringPiece _fname,
        int16_t& fid,
        apache::thrift::protocol::TType& _ftype) noexcept;
  };
  template <>
  struct TccStructTraits<::apache::thrift::test::TerseOptionalLazyFoo> {
    static void translateFieldName(
        folly::StringPiece _fname,
        int16_t& fid,
        apache::thrift::protocol::TType& _ftype) noexcept;
  };
  
  } // namespace detail
  } // namespace thrift
  } // namespace apache
  
  namespace apache { namespace thrift { namespace test {
  
  template <class Protocol_>
  void TerseFoo::readNoXfer(Protocol_* iprot) {
    apache::thrift::detail::ProtocolReaderStructReadState<Protocol_> _readState;
  
    _readState.readStructBegin(iprot);
  
    using apache::thrift::TProtocolException;
  
  
    THRIFT_IGNORE_ISSET_USE_WARNING_BEGIN
    if (UNLIKELY(!_readState.advanceToNextField(
            iprot,
            0,
            1,
            apache::thrift::protocol::T_LIST))) {
      goto _loop;
    }
  _readField_field1:
    {
      _readState.beforeSubobject(iprot);
      this->field1 = ::std::vector<double>();
      ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::list<::apache::thrift::type_class::floating_point>, ::std::vector<double>>::readWithContext(*iprot, this->field1, _readState);
      _readState.afterSubobject(iprot);
      
    }
   this->__isset.__fbthrift_set(folly::index_constant<0>(), true);
  
    if (UNLIKELY(!_readState.advanceToNextField(
            iprot,
            1,
            2,
            apache::thrift::protocol::T_LIST))) {
      goto _loop;
    }
  _readField_field2:
    {
      _readState.beforeSubobject(iprot);
      this->field2 = ::std::vector<::std::int32_t>();
      ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::list<::apache::thrift::type_class::integral>, ::std::vector<::std::int32_t>>::readWithContext(*iprot, this->field2, _readState);
      _readState.afterSubobject(iprot);
      
    }
   this->__isset.__fbthrift_set(folly::index_constant<1>(), true);
  
    if (UNLIKELY(!_readState.advanceToNextField(
            iprot,
            2,
            3,
            apache::thrift::protocol::T_LIST))) {
      goto _loop;
    }
  _readField_field3:
    {
      _readState.beforeSubobject(iprot);
      this->field3 = ::std::vector<double>();
      ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::list<::apache::thrift::type_class::floating_point>, ::std::vector<double>>::readWithContext(*iprot, this->field3, _readState);
      _readState.afterSubobject(iprot);
      
    }
   this->__isset.__fbthrift_set(folly::index_constant<2>(), true);
  
    if (UNLIKELY(!_readState.advanceToNextField(
            iprot,
            3,
            4,
            apache::thrift::protocol::T_LIST))) {
      goto _loop;
    }
  _readField_field4:
    {
      _readState.beforeSubobject(iprot);
      this->field4 = ::std::vector<::std::int32_t>();
      ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::list<::apache::thrift::type_class::integral>, ::std::vector<::std::int32_t>>::readWithContext(*iprot, this->field4, _readState);
      _readState.afterSubobject(iprot);
      
    }
   this->__isset.__fbthrift_set(folly::index_constant<3>(), true);
  
    if (UNLIKELY(!_readState.advanceToNextField(
            iprot,
            4,
            0,
            apache::thrift::protocol::T_STOP))) {
      goto _loop;
    }
    THRIFT_IGNORE_ISSET_USE_WARNING_END
  
  _end:
    _readState.readStructEnd(iprot);
  
    return;
  
  _loop:
    _readState.afterAdvanceFailure(iprot);
    if (_readState.atStop()) {
      goto _end;
    }
    if (iprot->kUsesFieldNames()) {
      _readState.template fillFieldTraitsFromName<apache::thrift::detail::TccStructTraits<TerseFoo>>();
    }
  
    switch (_readState.fieldId) {
      case 1:
      {
        if (LIKELY(_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_LIST))) {
          goto _readField_field1;
        } else {
          goto _skip;
        }
      }
      case 2:
      {
        if (LIKELY(_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_LIST))) {
          goto _readField_field2;
        } else {
          goto _skip;
        }
      }
      case 3:
      {
        if (LIKELY(_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_LIST))) {
          goto _readField_field3;
        } else {
          goto _skip;
        }
      }
      case 4:
      {
        if (LIKELY(_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_LIST))) {
          goto _readField_field4;
        } else {
          goto _skip;
        }
      }
      default:
      {
  _skip:
        _readState.skip(iprot);
        _readState.readFieldEnd(iprot);
        _readState.readFieldBeginNoInline(iprot);
        goto _loop;
      }
    }
  }
  
  template <class Protocol_>
  uint32_t TerseFoo::serializedSize(Protocol_ const* prot_) const {
    THRIFT_IGNORE_ISSET_USE_WARNING_BEGIN
    uint32_t xfer = 0;
    xfer += prot_->serializedStructSize("TerseFoo");
    if (!this->field1.empty()) {
      xfer += prot_->serializedFieldSize("field1", apache::thrift::protocol::T_LIST, 1);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::list<::apache::thrift::type_class::floating_point>, ::std::vector<double>>::serializedSize<false>(*prot_, this->field1);
    }
    if (!this->field2.empty()) {
      xfer += prot_->serializedFieldSize("field2", apache::thrift::protocol::T_LIST, 2);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::list<::apache::thrift::type_class::integral>, ::std::vector<::std::int32_t>>::serializedSize<false>(*prot_, this->field2);
    }
    if (!this->field3.empty()) {
      xfer += prot_->serializedFieldSize("field3", apache::thrift::protocol::T_LIST, 3);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::list<::apache::thrift::type_class::floating_point>, ::std::vector<double>>::serializedSize<false>(*prot_, this->field3);
    }
    if (!this->field4.empty()) {
      xfer += prot_->serializedFieldSize("field4", apache::thrift::protocol::T_LIST, 4);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::list<::apache::thrift::type_class::integral>, ::std::vector<::std::int32_t>>::serializedSize<false>(*prot_, this->field4);
    }
    xfer += prot_->serializedSizeStop();
    return xfer;
    THRIFT_IGNORE_ISSET_USE_WARNING_END
  }
  
  template <class Protocol_>
  uint32_t TerseFoo::serializedSizeZC(Protocol_ const* prot_) const {
    THRIFT_IGNORE_ISSET_USE_WARNING_BEGIN
    uint32_t xfer = 0;
    xfer += prot_->serializedStructSize("TerseFoo");
    if (!this->field1.empty()) {
      xfer += prot_->serializedFieldSize("field1", apache::thrift::protocol::T_LIST, 1);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::list<::apache::thrift::type_class::floating_point>, ::std::vector<double>>::serializedSize<false>(*prot_, this->field1);
    }
    if (!this->field2.empty()) {
      xfer += prot_->serializedFieldSize("field2", apache::thrift::protocol::T_LIST, 2);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::list<::apache::thrift::type_class::integral>, ::std::vector<::std::int32_t>>::serializedSize<false>(*prot_, this->field2);
    }
    if (!this->field3.empty()) {
      xfer += prot_->serializedFieldSize("field3", apache::thrift::protocol::T_LIST, 3);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::list<::apache::thrift::type_class::floating_point>, ::std::vector<double>>::serializedSize<false>(*prot_, this->field3);
    }
    if (!this->field4.empty()) {
      xfer += prot_->serializedFieldSize("field4", apache::thrift::protocol::T_LIST, 4);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::list<::apache::thrift::type_class::integral>, ::std::vector<::std::int32_t>>::serializedSize<false>(*prot_, this->field4);
    }
    xfer += prot_->serializedSizeStop();
    return xfer;
    THRIFT_IGNORE_ISSET_USE_WARNING_END
  }
  
  template <class Protocol_>
  uint32_t TerseFoo::write(Protocol_* prot_) const {
    THRIFT_IGNORE_ISSET_USE_WARNING_BEGIN
    uint32_t xfer = 0;
    xfer += prot_->writeStructBegin("TerseFoo");
    bool previousFieldHasValue = true;
    if (!this->field1.empty()) {
      constexpr int16_t kPrevFieldId = 0;
      xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_LIST, 1, kPrevFieldId>(*prot_, "field1", previousFieldHasValue);
      previousFieldHasValue = true;
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::list<::apache::thrift::type_class::floating_point>, ::std::vector<double>>::write(*prot_, this->field1);
      xfer += prot_->writeFieldEnd();
    } else {
      previousFieldHasValue = false;
    }
    if (!this->field2.empty()) {
      constexpr int16_t kPrevFieldId = 1;
      xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_LIST, 2, kPrevFieldId>(*prot_, "field2", previousFieldHasValue);
      previousFieldHasValue = true;
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::list<::apache::thrift::type_class::integral>, ::std::vector<::std::int32_t>>::write(*prot_, this->field2);
      xfer += prot_->writeFieldEnd();
    } else {
      previousFieldHasValue = false;
    }
    if (!this->field3.empty()) {
      constexpr int16_t kPrevFieldId = 2;
      xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_LIST, 3, kPrevFieldId>(*prot_, "field3", previousFieldHasValue);
      previousFieldHasValue = true;
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::list<::apache::thrift::type_class::floating_point>, ::std::vector<double>>::write(*prot_, this->field3);
      xfer += prot_->writeFieldEnd();
    } else {
      previousFieldHasValue = false;
    }
    if (!this->field4.empty()) {
      constexpr int16_t kPrevFieldId = 3;
      xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_LIST, 4, kPrevFieldId>(*prot_, "field4", previousFieldHasValue);
      previousFieldHasValue = true;
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::list<::apache::thrift::type_class::integral>, ::std::vector<::std::int32_t>>::write(*prot_, this->field4);
      xfer += prot_->writeFieldEnd();
    } else {
      previousFieldHasValue = false;
    }
    xfer += prot_->writeFieldStop();
    xfer += prot_->writeStructEnd();
    return xfer;
    THRIFT_IGNORE_ISSET_USE_WARNING_END
  }
  
  extern template void TerseFoo::readNoXfer<>(apache::thrift::BinaryProtocolReader*);
  extern template uint32_t TerseFoo::write<>(apache::thrift::BinaryProtocolWriter*) const;
  extern template uint32_t TerseFoo::serializedSize<>(apache::thrift::BinaryProtocolWriter const*) const;
  extern template uint32_t TerseFoo::serializedSizeZC<>(apache::thrift::BinaryProtocolWriter const*) const;
  extern template void TerseFoo::readNoXfer<>(apache::thrift::CompactProtocolReader*);
  extern template uint32_t TerseFoo::write<>(apache::thrift::CompactProtocolWriter*) const;
  extern template uint32_t TerseFoo::serializedSize<>(apache::thrift::CompactProtocolWriter const*) const;
  extern template uint32_t TerseFoo::serializedSizeZC<>(apache::thrift::CompactProtocolWriter const*) const;
  
  }}} // apache::thrift::test
  namespace apache { namespace thrift { namespace test {
  
  template <class Protocol_>
  void TerseLazyFoo::readNoXfer(Protocol_* iprot) {
    apache::thrift::detail::ProtocolReaderStructReadStateWithIndex<Protocol_> _readState;
  
    _readState.readStructBegin(iprot);
  
    using apache::thrift::TProtocolException;
  
    if (__fbthrift_protocol_ != iprot->protocolType()) {
      std::as_const(*this).__fbthrift_read_field_field3();
      std::as_const(*this).__fbthrift_read_field_field4();
      __fbthrift_protocol_ = iprot->protocolType();
    }
  
    THRIFT_IGNORE_ISSET_USE_WARNING_BEGIN
    if (UNLIKELY(!_readState.advanceToNextField(
            iprot,
            0,
            1,
            apache::thrift::protocol::T_LIST))) {
      goto _loop;
    }
  _readField_field1:
    {
      _readState.beforeSubobject(iprot);
      this->field1 = ::std::vector<double>();
      ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::list<::apache::thrift::type_class::floating_point>, ::std::vector<double>>::readWithContext(*iprot, this->field1, _readState);
      _readState.afterSubobject(iprot);
      
    }
   this->__isset.__fbthrift_set(folly::index_constant<0>(), true);
  
    if (UNLIKELY(!_readState.advanceToNextField(
            iprot,
            1,
            2,
            apache::thrift::protocol::T_LIST))) {
      goto _loop;
    }
  _readField_field2:
    {
      _readState.beforeSubobject(iprot);
      this->field2 = ::std::vector<::std::int32_t>();
      ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::list<::apache::thrift::type_class::integral>, ::std::vector<::std::int32_t>>::readWithContext(*iprot, this->field2, _readState);
      _readState.afterSubobject(iprot);
      
    }
   this->__isset.__fbthrift_set(folly::index_constant<1>(), true);
  
    if (UNLIKELY(!_readState.advanceToNextField(
            iprot,
            2,
            3,
            apache::thrift::protocol::T_LIST))) {
      goto _loop;
    }
  _readField_field3:
    std::as_const(*this).__fbthrift_read_field_field3();
    if (auto iobuf = _readState.tryFastSkip(
            iprot,
            3,
            apache::thrift::protocol::T_LIST,
            apache::thrift::fixed_cost_skip_v<Protocol_,
                                              ::apache::thrift::type_class::list<::apache::thrift::type_class::floating_point>,
                                              ::std::vector<double>>)) {
      const auto isDeserialized = __fbthrift_isDeserialized_.field3.load();
      __fbthrift_serializedData_.field3 = std::move(*iobuf);
      __fbthrift_isDeserialized_.field3 = isDeserialized & ~::apache::thrift::detail::LazyDeserializationState::DESERIALIZED;
    } else {
      _readState.beforeSubobject(iprot);
      this->field3 = ::std::vector<double>();
      ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::list<::apache::thrift::type_class::floating_point>, ::std::vector<double>>::readWithContext(*iprot, this->field3, _readState);
      _readState.afterSubobject(iprot);
      
    }
   this->__isset.__fbthrift_set(folly::index_constant<2>(), true);
  
    if (UNLIKELY(!_readState.advanceToNextField(
            iprot,
            3,
            4,
            apache::thrift::protocol::T_LIST))) {
      goto _loop;
    }
  _readField_field4:
    std::as_const(*this).__fbthrift_read_field_field4();
    if (auto iobuf = _readState.tryFastSkip(
            iprot,
            4,
            apache::thrift::protocol::T_LIST,
            apache::thrift::fixed_cost_skip_v<Protocol_,
                                              ::apache::thrift::type_class::list<::apache::thrift::type_class::integral>,
                                              ::std::vector<::std::int32_t>>)) {
      const auto isDeserialized = __fbthrift_isDeserialized_.field4.load();
      __fbthrift_serializedData_.field4 = std::move(*iobuf);
      __fbthrift_isDeserialized_.field4 = isDeserialized & ~::apache::thrift::detail::LazyDeserializationState::DESERIALIZED;
    } else {
      _readState.beforeSubobject(iprot);
      this->field4 = ::std::vector<::std::int32_t>();
      ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::list<::apache::thrift::type_class::integral>, ::std::vector<::std::int32_t>>::readWithContext(*iprot, this->field4, _readState);
      _readState.afterSubobject(iprot);
      
    }
   this->__isset.__fbthrift_set(folly::index_constant<3>(), true);
  
    if (UNLIKELY(!_readState.advanceToNextField(
            iprot,
            4,
            0,
            apache::thrift::protocol::T_STOP))) {
      goto _loop;
    }
    THRIFT_IGNORE_ISSET_USE_WARNING_END
  
  _end:
    _readState.readStructEnd(iprot);
  
    return;
  
  _loop:
    _readState.afterAdvanceFailure(iprot);
    if (_readState.atStop()) {
      goto _end;
    }
    if (iprot->kUsesFieldNames()) {
      _readState.template fillFieldTraitsFromName<apache::thrift::detail::TccStructTraits<TerseLazyFoo>>();
    }
  
    switch (_readState.fieldId) {
      case 1:
      {
        if (LIKELY(_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_LIST))) {
          goto _readField_field1;
        } else {
          goto _skip;
        }
      }
      case 2:
      {
        if (LIKELY(_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_LIST))) {
          goto _readField_field2;
        } else {
          goto _skip;
        }
      }
      case 3:
      {
        if (LIKELY(_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_LIST))) {
          goto _readField_field3;
        } else {
          goto _skip;
        }
      }
      case 4:
      {
        if (LIKELY(_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_LIST))) {
          goto _readField_field4;
        } else {
          goto _skip;
        }
      }
      default:
      {
  _skip:
        _readState.skip(iprot);
        _readState.readFieldEnd(iprot);
        _readState.readFieldBeginNoInline(iprot);
        goto _loop;
      }
    }
  }
  template<class ProtocolReader>
  void TerseLazyFoo::__fbthrift_read_field_field3_impl() const {
    ProtocolReader reader;
    reader.setInput(&__fbthrift_serializedData_.field3);
    ProtocolReader *iprot = &reader;
    apache::thrift::detail::ProtocolReaderStructReadState<ProtocolReader> _readState;
    _readState.beforeSubobject(iprot);
    this->field3 = ::std::vector<double>();
    ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::list<::apache::thrift::type_class::floating_point>, ::std::vector<double>>::readWithContext(*iprot, this->field3, _readState);
    _readState.afterSubobject(iprot);
    }
  template<class ProtocolReader>
  void TerseLazyFoo::__fbthrift_read_field_field4_impl() const {
    ProtocolReader reader;
    reader.setInput(&__fbthrift_serializedData_.field4);
    ProtocolReader *iprot = &reader;
    apache::thrift::detail::ProtocolReaderStructReadState<ProtocolReader> _readState;
    _readState.beforeSubobject(iprot);
    this->field4 = ::std::vector<::std::int32_t>();
    ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::list<::apache::thrift::type_class::integral>, ::std::vector<::std::int32_t>>::readWithContext(*iprot, this->field4, _readState);
    _readState.afterSubobject(iprot);
    }
  
  template <class Protocol_>
  uint32_t TerseLazyFoo::serializedSize(Protocol_ const* prot_) const {
    THRIFT_IGNORE_ISSET_USE_WARNING_BEGIN
    uint32_t xfer = 0;
    xfer += prot_->serializedStructSize("TerseLazyFoo");
    if (!this->field1.empty()) {
      xfer += prot_->serializedFieldSize("field1", apache::thrift::protocol::T_LIST, 1);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::list<::apache::thrift::type_class::floating_point>, ::std::vector<double>>::serializedSize<false>(*prot_, this->field1);
    }
    if (!this->field2.empty()) {
      xfer += prot_->serializedFieldSize("field2", apache::thrift::protocol::T_LIST, 2);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::list<::apache::thrift::type_class::integral>, ::std::vector<::std::int32_t>>::serializedSize<false>(*prot_, this->field2);
    }
    if (!(__fbthrift_isDeserialized_.field3 & ::apache::thrift::detail::LazyDeserializationState::DESERIALIZED) || 
      !this->field3.empty()) {
      xfer += prot_->serializedFieldSize("field3", apache::thrift::protocol::T_LIST, 3);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::list<::apache::thrift::type_class::floating_point>, ::std::vector<double>>::serializedSize<false>(*prot_, this->field3);
    }
    if (!(__fbthrift_isDeserialized_.field4 & ::apache::thrift::detail::LazyDeserializationState::DESERIALIZED) || 
      !this->field4.empty()) {
      xfer += prot_->serializedFieldSize("field4", apache::thrift::protocol::T_LIST, 4);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::list<::apache::thrift::type_class::integral>, ::std::vector<::std::int32_t>>::serializedSize<false>(*prot_, this->field4);
    }
    xfer += prot_->serializedSizeStop();
    return xfer;
    THRIFT_IGNORE_ISSET_USE_WARNING_END
  }
  
  template <class Protocol_>
  uint32_t TerseLazyFoo::serializedSizeZC(Protocol_ const* prot_) const {
    THRIFT_IGNORE_ISSET_USE_WARNING_BEGIN
    uint32_t xfer = 0;
    xfer += prot_->serializedStructSize("TerseLazyFoo");
    if (!this->field1.empty()) {
      xfer += prot_->serializedFieldSize("field1", apache::thrift::protocol::T_LIST, 1);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::list<::apache::thrift::type_class::floating_point>, ::std::vector<double>>::serializedSize<false>(*prot_, this->field1);
    }
    if (!this->field2.empty()) {
      xfer += prot_->serializedFieldSize("field2", apache::thrift::protocol::T_LIST, 2);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::list<::apache::thrift::type_class::integral>, ::std::vector<::std::int32_t>>::serializedSize<false>(*prot_, this->field2);
    }
    if (!(__fbthrift_isDeserialized_.field3 & ::apache::thrift::detail::LazyDeserializationState::DESERIALIZED) || 
      !this->field3.empty()) {
      xfer += prot_->serializedFieldSize("field3", apache::thrift::protocol::T_LIST, 3);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::list<::apache::thrift::type_class::floating_point>, ::std::vector<double>>::serializedSize<false>(*prot_, this->field3);
    }
    if (!(__fbthrift_isDeserialized_.field4 & ::apache::thrift::detail::LazyDeserializationState::DESERIALIZED) || 
      !this->field4.empty()) {
      xfer += prot_->serializedFieldSize("field4", apache::thrift::protocol::T_LIST, 4);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::list<::apache::thrift::type_class::integral>, ::std::vector<::std::int32_t>>::serializedSize<false>(*prot_, this->field4);
    }
    xfer += prot_->serializedSizeStop();
    return xfer;
    THRIFT_IGNORE_ISSET_USE_WARNING_END
  }
  
  template <class Protocol_>
  uint32_t TerseLazyFoo::write(Protocol_* prot_) const {
    THRIFT_IGNORE_ISSET_USE_WARNING_BEGIN
    uint32_t xfer = 0;
    xfer += prot_->writeStructBegin("TerseLazyFoo");
    ::apache::thrift::detail::IndexWriter<Protocol_> indexWriter(prot_, xfer);
    bool previousFieldHasValue = true;
    if (!this->field1.empty()) {
      constexpr int16_t kPrevFieldId = ::apache::thrift::detail::kSizeField.id;
      xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_LIST, 1, kPrevFieldId>(*prot_, "field1", previousFieldHasValue);
      previousFieldHasValue = true;
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::list<::apache::thrift::type_class::floating_point>, ::std::vector<double>>::write(*prot_, this->field1);
      xfer += prot_->writeFieldEnd();
    } else {
      previousFieldHasValue = false;
    }
    if (!this->field2.empty()) {
      constexpr int16_t kPrevFieldId = 1;
      xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_LIST, 2, kPrevFieldId>(*prot_, "field2", previousFieldHasValue);
      previousFieldHasValue = true;
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::list<::apache::thrift::type_class::integral>, ::std::vector<::std::int32_t>>::write(*prot_, this->field2);
      xfer += prot_->writeFieldEnd();
    } else {
      previousFieldHasValue = false;
    }
    if (!(__fbthrift_isDeserialized_.field3 & ::apache::thrift::detail::LazyDeserializationState::DESERIALIZED) || 
      !this->field3.empty()) {
      constexpr int16_t kPrevFieldId = 2;
      xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_LIST, 3, kPrevFieldId>(*prot_, "field3", previousFieldHasValue);
      previousFieldHasValue = true;
      indexWriter.recordFieldStart();
      if constexpr (Protocol_::kHasIndexSupport()) {
        if (prot_->protocolType() == __fbthrift_protocol_ && __fbthrift_isDeserialized_.field3.load() == ::apache::thrift::detail::LazyDeserializationState::UNTAINTED) {
          xfer += prot_->writeRaw(__fbthrift_serializedData_.field3);
          goto written_lazy_field_field3;
        }
      }
      std::as_const(*this).__fbthrift_read_field_field3();
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::list<::apache::thrift::type_class::floating_point>, ::std::vector<double>>::write(*prot_, this->field3);
      written_lazy_field_field3:
      indexWriter.recordFieldEnd(::apache::thrift::type_class::list<::apache::thrift::type_class::floating_point>{}, this->field3, 3);
      xfer += prot_->writeFieldEnd();
    } else {
      previousFieldHasValue = false;
    }
    if (!(__fbthrift_isDeserialized_.field4 & ::apache::thrift::detail::LazyDeserializationState::DESERIALIZED) || 
      !this->field4.empty()) {
      constexpr int16_t kPrevFieldId = 3;
      xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_LIST, 4, kPrevFieldId>(*prot_, "field4", previousFieldHasValue);
      previousFieldHasValue = true;
      indexWriter.recordFieldStart();
      if constexpr (Protocol_::kHasIndexSupport()) {
        if (prot_->protocolType() == __fbthrift_protocol_ && __fbthrift_isDeserialized_.field4.load() == ::apache::thrift::detail::LazyDeserializationState::UNTAINTED) {
          xfer += prot_->writeRaw(__fbthrift_serializedData_.field4);
          goto written_lazy_field_field4;
        }
      }
      std::as_const(*this).__fbthrift_read_field_field4();
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::list<::apache::thrift::type_class::integral>, ::std::vector<::std::int32_t>>::write(*prot_, this->field4);
      written_lazy_field_field4:
      indexWriter.recordFieldEnd(::apache::thrift::type_class::list<::apache::thrift::type_class::integral>{}, this->field4, 4);
      xfer += prot_->writeFieldEnd();
    } else {
      previousFieldHasValue = false;
    }
    indexWriter.finalize();
    xfer += prot_->writeFieldStop();
    xfer += prot_->writeStructEnd();
    return xfer;
    THRIFT_IGNORE_ISSET_USE_WARNING_END
  }
  
  extern template void TerseLazyFoo::readNoXfer<>(apache::thrift::BinaryProtocolReader*);
  extern template uint32_t TerseLazyFoo::write<>(apache::thrift::BinaryProtocolWriter*) const;
  extern template uint32_t TerseLazyFoo::serializedSize<>(apache::thrift::BinaryProtocolWriter const*) const;
  extern template uint32_t TerseLazyFoo::serializedSizeZC<>(apache::thrift::BinaryProtocolWriter const*) const;
  extern template void TerseLazyFoo::readNoXfer<>(apache::thrift::CompactProtocolReader*);
  extern template uint32_t TerseLazyFoo::write<>(apache::thrift::CompactProtocolWriter*) const;
  extern template uint32_t TerseLazyFoo::serializedSize<>(apache::thrift::CompactProtocolWriter const*) const;
  extern template uint32_t TerseLazyFoo::serializedSizeZC<>(apache::thrift::CompactProtocolWriter const*) const;
  
  }}} // apache::thrift::test
  namespace apache { namespace thrift { namespace test {
  
  template <class Protocol_>
  void TerseOptionalFoo::readNoXfer(Protocol_* iprot) {
    apache::thrift::detail::ProtocolReaderStructReadState<Protocol_> _readState;
  
    _readState.readStructBegin(iprot);
  
    using apache::thrift::TProtocolException;
  
  
    THRIFT_IGNORE_ISSET_USE_WARNING_BEGIN
    if (UNLIKELY(!_readState.advanceToNextField(
            iprot,
            0,
            1,
            apache::thrift::protocol::T_LIST))) {
      goto _loop;
    }
  _readField_field1:
    {
      _readState.beforeSubobject(iprot);
      this->field1 = ::std::vector<double>();
      ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::list<::apache::thrift::type_class::floating_point>, ::std::vector<double>>::readWithContext(*iprot, this->field1, _readState);
      _readState.afterSubobject(iprot);
      
    }
   this->__isset.__fbthrift_set(folly::index_constant<0>(), true);
  
    if (UNLIKELY(!_readState.advanceToNextField(
            iprot,
            1,
            2,
            apache::thrift::protocol::T_LIST))) {
      goto _loop;
    }
  _readField_field2:
    {
      _readState.beforeSubobject(iprot);
      this->field2 = ::std::vector<::std::int32_t>();
      ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::list<::apache::thrift::type_class::integral>, ::std::vector<::std::int32_t>>::readWithContext(*iprot, this->field2, _readState);
      _readState.afterSubobject(iprot);
      
    }
   this->__isset.__fbthrift_set(folly::index_constant<1>(), true);
  
    if (UNLIKELY(!_readState.advanceToNextField(
            iprot,
            2,
            3,
            apache::thrift::protocol::T_LIST))) {
      goto _loop;
    }
  _readField_field3:
    {
      _readState.beforeSubobject(iprot);
      this->field3 = ::std::vector<double>();
      ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::list<::apache::thrift::type_class::floating_point>, ::std::vector<double>>::readWithContext(*iprot, this->field3, _readState);
      _readState.afterSubobject(iprot);
      
    }
   this->__isset.__fbthrift_set(folly::index_constant<2>(), true);
  
    if (UNLIKELY(!_readState.advanceToNextField(
            iprot,
            3,
            4,
            apache::thrift::protocol::T_LIST))) {
      goto _loop;
    }
  _readField_field4:
    {
      _readState.beforeSubobject(iprot);
      this->field4 = ::std::vector<::std::int32_t>();
      ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::list<::apache::thrift::type_class::integral>, ::std::vector<::std::int32_t>>::readWithContext(*iprot, this->field4, _readState);
      _readState.afterSubobject(iprot);
      
    }
   this->__isset.__fbthrift_set(folly::index_constant<3>(), true);
  
    if (UNLIKELY(!_readState.advanceToNextField(
            iprot,
            4,
            0,
            apache::thrift::protocol::T_STOP))) {
      goto _loop;
    }
    THRIFT_IGNORE_ISSET_USE_WARNING_END
  
  _end:
    _readState.readStructEnd(iprot);
  
    return;
  
  _loop:
    _readState.afterAdvanceFailure(iprot);
    if (_readState.atStop()) {
      goto _end;
    }
    if (iprot->kUsesFieldNames()) {
      _readState.template fillFieldTraitsFromName<apache::thrift::detail::TccStructTraits<TerseOptionalFoo>>();
    }
  
    switch (_readState.fieldId) {
      case 1:
      {
        if (LIKELY(_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_LIST))) {
          goto _readField_field1;
        } else {
          goto _skip;
        }
      }
      case 2:
      {
        if (LIKELY(_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_LIST))) {
          goto _readField_field2;
        } else {
          goto _skip;
        }
      }
      case 3:
      {
        if (LIKELY(_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_LIST))) {
          goto _readField_field3;
        } else {
          goto _skip;
        }
      }
      case 4:
      {
        if (LIKELY(_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_LIST))) {
          goto _readField_field4;
        } else {
          goto _skip;
        }
      }
      default:
      {
  _skip:
        _readState.skip(iprot);
        _readState.readFieldEnd(iprot);
        _readState.readFieldBeginNoInline(iprot);
        goto _loop;
      }
    }
  }
  
  template <class Protocol_>
  uint32_t TerseOptionalFoo::serializedSize(Protocol_ const* prot_) const {
    THRIFT_IGNORE_ISSET_USE_WARNING_BEGIN
    uint32_t xfer = 0;
    xfer += prot_->serializedStructSize("TerseOptionalFoo");
    if (this->__isset.__fbthrift_get(folly::index_constant<0>())) {
      xfer += prot_->serializedFieldSize("field1", apache::thrift::protocol::T_LIST, 1);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::list<::apache::thrift::type_class::floating_point>, ::std::vector<double>>::serializedSize<false>(*prot_, this->field1);
    }
    if (this->__isset.__fbthrift_get(folly::index_constant<1>())) {
      xfer += prot_->serializedFieldSize("field2", apache::thrift::protocol::T_LIST, 2);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::list<::apache::thrift::type_class::integral>, ::std::vector<::std::int32_t>>::serializedSize<false>(*prot_, this->field2);
    }
    if (this->__isset.__fbthrift_get(folly::index_constant<2>())) {
      xfer += prot_->serializedFieldSize("field3", apache::thrift::protocol::T_LIST, 3);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::list<::apache::thrift::type_class::floating_point>, ::std::vector<double>>::serializedSize<false>(*prot_, this->field3);
    }
    if (this->__isset.__fbthrift_get(folly::index_constant<3>())) {
      xfer += prot_->serializedFieldSize("field4", apache::thrift::protocol::T_LIST, 4);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::list<::apache::thrift::type_class::integral>, ::std::vector<::std::int32_t>>::serializedSize<false>(*prot_, this->field4);
    }
    xfer += prot_->serializedSizeStop();
    return xfer;
    THRIFT_IGNORE_ISSET_USE_WARNING_END
  }
  
  template <class Protocol_>
  uint32_t TerseOptionalFoo::serializedSizeZC(Protocol_ const* prot_) const {
    THRIFT_IGNORE_ISSET_USE_WARNING_BEGIN
    uint32_t xfer = 0;
    xfer += prot_->serializedStructSize("TerseOptionalFoo");
    if (this->__isset.__fbthrift_get(folly::index_constant<0>())) {
      xfer += prot_->serializedFieldSize("field1", apache::thrift::protocol::T_LIST, 1);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::list<::apache::thrift::type_class::floating_point>, ::std::vector<double>>::serializedSize<false>(*prot_, this->field1);
    }
    if (this->__isset.__fbthrift_get(folly::index_constant<1>())) {
      xfer += prot_->serializedFieldSize("field2", apache::thrift::protocol::T_LIST, 2);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::list<::apache::thrift::type_class::integral>, ::std::vector<::std::int32_t>>::serializedSize<false>(*prot_, this->field2);
    }
    if (this->__isset.__fbthrift_get(folly::index_constant<2>())) {
      xfer += prot_->serializedFieldSize("field3", apache::thrift::protocol::T_LIST, 3);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::list<::apache::thrift::type_class::floating_point>, ::std::vector<double>>::serializedSize<false>(*prot_, this->field3);
    }
    if (this->__isset.__fbthrift_get(folly::index_constant<3>())) {
      xfer += prot_->serializedFieldSize("field4", apache::thrift::protocol::T_LIST, 4);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::list<::apache::thrift::type_class::integral>, ::std::vector<::std::int32_t>>::serializedSize<false>(*prot_, this->field4);
    }
    xfer += prot_->serializedSizeStop();
    return xfer;
    THRIFT_IGNORE_ISSET_USE_WARNING_END
  }
  
  template <class Protocol_>
  uint32_t TerseOptionalFoo::write(Protocol_* prot_) const {
    THRIFT_IGNORE_ISSET_USE_WARNING_BEGIN
    uint32_t xfer = 0;
    xfer += prot_->writeStructBegin("TerseOptionalFoo");
    bool previousFieldHasValue = true;
    if (this->__isset.__fbthrift_get(folly::index_constant<0>())) {
      constexpr int16_t kPrevFieldId = 0;
      xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_LIST, 1, kPrevFieldId>(*prot_, "field1", previousFieldHasValue);
      previousFieldHasValue = true;
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::list<::apache::thrift::type_class::floating_point>, ::std::vector<double>>::write(*prot_, this->field1);
      xfer += prot_->writeFieldEnd();
    } else {
      previousFieldHasValue = false;
    }
    if (this->__isset.__fbthrift_get(folly::index_constant<1>())) {
      constexpr int16_t kPrevFieldId = 1;
      xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_LIST, 2, kPrevFieldId>(*prot_, "field2", previousFieldHasValue);
      previousFieldHasValue = true;
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::list<::apache::thrift::type_class::integral>, ::std::vector<::std::int32_t>>::write(*prot_, this->field2);
      xfer += prot_->writeFieldEnd();
    } else {
      previousFieldHasValue = false;
    }
    if (this->__isset.__fbthrift_get(folly::index_constant<2>())) {
      constexpr int16_t kPrevFieldId = 2;
      xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_LIST, 3, kPrevFieldId>(*prot_, "field3", previousFieldHasValue);
      previousFieldHasValue = true;
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::list<::apache::thrift::type_class::floating_point>, ::std::vector<double>>::write(*prot_, this->field3);
      xfer += prot_->writeFieldEnd();
    } else {
      previousFieldHasValue = false;
    }
    if (this->__isset.__fbthrift_get(folly::index_constant<3>())) {
      constexpr int16_t kPrevFieldId = 3;
      xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_LIST, 4, kPrevFieldId>(*prot_, "field4", previousFieldHasValue);
      previousFieldHasValue = true;
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::list<::apache::thrift::type_class::integral>, ::std::vector<::std::int32_t>>::write(*prot_, this->field4);
      xfer += prot_->writeFieldEnd();
    } else {
      previousFieldHasValue = false;
    }
    xfer += prot_->writeFieldStop();
    xfer += prot_->writeStructEnd();
    return xfer;
    THRIFT_IGNORE_ISSET_USE_WARNING_END
  }
  
  extern template void TerseOptionalFoo::readNoXfer<>(apache::thrift::BinaryProtocolReader*);
  extern template uint32_t TerseOptionalFoo::write<>(apache::thrift::BinaryProtocolWriter*) const;
  extern template uint32_t TerseOptionalFoo::serializedSize<>(apache::thrift::BinaryProtocolWriter const*) const;
  extern template uint32_t TerseOptionalFoo::serializedSizeZC<>(apache::thrift::BinaryProtocolWriter const*) const;
  extern template void TerseOptionalFoo::readNoXfer<>(apache::thrift::CompactProtocolReader*);
  extern template uint32_t TerseOptionalFoo::write<>(apache::thrift::CompactProtocolWriter*) const;
  extern template uint32_t TerseOptionalFoo::serializedSize<>(apache::thrift::CompactProtocolWriter const*) const;
  extern template uint32_t TerseOptionalFoo::serializedSizeZC<>(apache::thrift::CompactProtocolWriter const*) const;
  
  }}} // apache::thrift::test
  namespace apache { namespace thrift { namespace test {
  
  template <class Protocol_>
  void TerseOptionalLazyFoo::readNoXfer(Protocol_* iprot) {
    apache::thrift::detail::ProtocolReaderStructReadStateWithIndex<Protocol_> _readState;
  
    _readState.readStructBegin(iprot);
  
    using apache::thrift::TProtocolException;
  
    if (__fbthrift_protocol_ != iprot->protocolType()) {
      std::as_const(*this).__fbthrift_read_field_field3();
      std::as_const(*this).__fbthrift_read_field_field4();
      __fbthrift_protocol_ = iprot->protocolType();
    }
  
    THRIFT_IGNORE_ISSET_USE_WARNING_BEGIN
    if (UNLIKELY(!_readState.advanceToNextField(
            iprot,
            0,
            1,
            apache::thrift::protocol::T_LIST))) {
      goto _loop;
    }
  _readField_field1:
    {
      _readState.beforeSubobject(iprot);
      this->field1 = ::std::vector<double>();
      ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::list<::apache::thrift::type_class::floating_point>, ::std::vector<double>>::readWithContext(*iprot, this->field1, _readState);
      _readState.afterSubobject(iprot);
      
    }
   this->__isset.__fbthrift_set(folly::index_constant<0>(), true);
  
    if (UNLIKELY(!_readState.advanceToNextField(
            iprot,
            1,
            2,
            apache::thrift::protocol::T_LIST))) {
      goto _loop;
    }
  _readField_field2:
    {
      _readState.beforeSubobject(iprot);
      this->field2 = ::std::vector<::std::int32_t>();
      ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::list<::apache::thrift::type_class::integral>, ::std::vector<::std::int32_t>>::readWithContext(*iprot, this->field2, _readState);
      _readState.afterSubobject(iprot);
      
    }
   this->__isset.__fbthrift_set(folly::index_constant<1>(), true);
  
    if (UNLIKELY(!_readState.advanceToNextField(
            iprot,
            2,
            3,
            apache::thrift::protocol::T_LIST))) {
      goto _loop;
    }
  _readField_field3:
    std::as_const(*this).__fbthrift_read_field_field3();
    if (auto iobuf = _readState.tryFastSkip(
            iprot,
            3,
            apache::thrift::protocol::T_LIST,
            apache::thrift::fixed_cost_skip_v<Protocol_,
                                              ::apache::thrift::type_class::list<::apache::thrift::type_class::floating_point>,
                                              ::std::vector<double>>)) {
      const auto isDeserialized = __fbthrift_isDeserialized_.field3.load();
      __fbthrift_serializedData_.field3 = std::move(*iobuf);
      __fbthrift_isDeserialized_.field3 = isDeserialized & ~::apache::thrift::detail::LazyDeserializationState::DESERIALIZED;
    } else {
      _readState.beforeSubobject(iprot);
      this->field3 = ::std::vector<double>();
      ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::list<::apache::thrift::type_class::floating_point>, ::std::vector<double>>::readWithContext(*iprot, this->field3, _readState);
      _readState.afterSubobject(iprot);
      
    }
   this->__isset.__fbthrift_set(folly::index_constant<2>(), true);
  
    if (UNLIKELY(!_readState.advanceToNextField(
            iprot,
            3,
            4,
            apache::thrift::protocol::T_LIST))) {
      goto _loop;
    }
  _readField_field4:
    std::as_const(*this).__fbthrift_read_field_field4();
    if (auto iobuf = _readState.tryFastSkip(
            iprot,
            4,
            apache::thrift::protocol::T_LIST,
            apache::thrift::fixed_cost_skip_v<Protocol_,
                                              ::apache::thrift::type_class::list<::apache::thrift::type_class::integral>,
                                              ::std::vector<::std::int32_t>>)) {
      const auto isDeserialized = __fbthrift_isDeserialized_.field4.load();
      __fbthrift_serializedData_.field4 = std::move(*iobuf);
      __fbthrift_isDeserialized_.field4 = isDeserialized & ~::apache::thrift::detail::LazyDeserializationState::DESERIALIZED;
    } else {
      _readState.beforeSubobject(iprot);
      this->field4 = ::std::vector<::std::int32_t>();
      ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::list<::apache::thrift::type_class::integral>, ::std::vector<::std::int32_t>>::readWithContext(*iprot, this->field4, _readState);
      _readState.afterSubobject(iprot);
      
    }
   this->__isset.__fbthrift_set(folly::index_constant<3>(), true);
  
    if (UNLIKELY(!_readState.advanceToNextField(
            iprot,
            4,
            0,
            apache::thrift::protocol::T_STOP))) {
      goto _loop;
    }
    THRIFT_IGNORE_ISSET_USE_WARNING_END
  
  _end:
    _readState.readStructEnd(iprot);
  
    return;
  
  _loop:
    _readState.afterAdvanceFailure(iprot);
    if (_readState.atStop()) {
      goto _end;
    }
    if (iprot->kUsesFieldNames()) {
      _readState.template fillFieldTraitsFromName<apache::thrift::detail::TccStructTraits<TerseOptionalLazyFoo>>();
    }
  
    switch (_readState.fieldId) {
      case 1:
      {
        if (LIKELY(_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_LIST))) {
          goto _readField_field1;
        } else {
          goto _skip;
        }
      }
      case 2:
      {
        if (LIKELY(_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_LIST))) {
          goto _readField_field2;
        } else {
          goto _skip;
        }
      }
      case 3:
      {
        if (LIKELY(_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_LIST))) {
          goto _readField_field3;
        } else {
          goto _skip;
        }
      }
      case 4:
      {
        if (LIKELY(_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_LIST))) {
          goto _readField_field4;
        } else {
          goto _skip;
        }
      }
      default:
      {
  _skip:
        _readState.skip(iprot);
        _readState.readFieldEnd(iprot);
        _readState.readFieldBeginNoInline(iprot);
        goto _loop;
      }
    }
  }
  template<class ProtocolReader>
  void TerseOptionalLazyFoo::__fbthrift_read_field_field3_impl() const {
    ProtocolReader reader;
    reader.setInput(&__fbthrift_serializedData_.field3);
    ProtocolReader *iprot = &reader;
    apache::thrift::detail::ProtocolReaderStructReadState<ProtocolReader> _readState;
    _readState.beforeSubobject(iprot);
    this->field3 = ::std::vector<double>();
    ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::list<::apache::thrift::type_class::floating_point>, ::std::vector<double>>::readWithContext(*iprot, this->field3, _readState);
    _readState.afterSubobject(iprot);
    }
  template<class ProtocolReader>
  void TerseOptionalLazyFoo::__fbthrift_read_field_field4_impl() const {
    ProtocolReader reader;
    reader.setInput(&__fbthrift_serializedData_.field4);
    ProtocolReader *iprot = &reader;
    apache::thrift::detail::ProtocolReaderStructReadState<ProtocolReader> _readState;
    _readState.beforeSubobject(iprot);
    this->field4 = ::std::vector<::std::int32_t>();
    ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::list<::apache::thrift::type_class::integral>, ::std::vector<::std::int32_t>>::readWithContext(*iprot, this->field4, _readState);
    _readState.afterSubobject(iprot);
    }
  
  template <class Protocol_>
  uint32_t TerseOptionalLazyFoo::serializedSize(Protocol_ const* prot_) const {
    THRIFT_IGNORE_ISSET_USE_WARNING_BEGIN
    uint32_t xfer = 0;
    xfer += prot_->serializedStructSize("TerseOptionalLazyFoo");
    if (this->__isset.__fbthrift_get(folly::index_constant<0>())) {
      xfer += prot_->serializedFieldSize("field1", apache::thrift::protocol::T_LIST, 1);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::list<::apache::thrift::type_class::floating_point>, ::std::vector<double>>::serializedSize<false>(*prot_, this->field1);
    }
    if (this->__isset.__fbthrift_get(folly::index_constant<1>())) {
      xfer += prot_->serializedFieldSize("field2", apache::thrift::protocol::T_LIST, 2);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::list<::apache::thrift::type_class::integral>, ::std::vector<::std::int32_t>>::serializedSize<false>(*prot_, this->field2);
    }
    if (this->__isset.__fbthrift_get(folly::index_constant<2>())) {
      xfer += prot_->serializedFieldSize("field3", apache::thrift::protocol::T_LIST, 3);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::list<::apache::thrift::type_class::floating_point>, ::std::vector<double>>::serializedSize<false>(*prot_, this->field3);
    }
    if (this->__isset.__fbthrift_get(folly::index_constant<3>())) {
      xfer += prot_->serializedFieldSize("field4", apache::thrift::protocol::T_LIST, 4);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::list<::apache::thrift::type_class::integral>, ::std::vector<::std::int32_t>>::serializedSize<false>(*prot_, this->field4);
    }
    xfer += prot_->serializedSizeStop();
    return xfer;
    THRIFT_IGNORE_ISSET_USE_WARNING_END
  }
  
  template <class Protocol_>
  uint32_t TerseOptionalLazyFoo::serializedSizeZC(Protocol_ const* prot_) const {
    THRIFT_IGNORE_ISSET_USE_WARNING_BEGIN
    uint32_t xfer = 0;
    xfer += prot_->serializedStructSize("TerseOptionalLazyFoo");
    if (this->__isset.__fbthrift_get(folly::index_constant<0>())) {
      xfer += prot_->serializedFieldSize("field1", apache::thrift::protocol::T_LIST, 1);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::list<::apache::thrift::type_class::floating_point>, ::std::vector<double>>::serializedSize<false>(*prot_, this->field1);
    }
    if (this->__isset.__fbthrift_get(folly::index_constant<1>())) {
      xfer += prot_->serializedFieldSize("field2", apache::thrift::protocol::T_LIST, 2);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::list<::apache::thrift::type_class::integral>, ::std::vector<::std::int32_t>>::serializedSize<false>(*prot_, this->field2);
    }
    if (this->__isset.__fbthrift_get(folly::index_constant<2>())) {
      xfer += prot_->serializedFieldSize("field3", apache::thrift::protocol::T_LIST, 3);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::list<::apache::thrift::type_class::floating_point>, ::std::vector<double>>::serializedSize<false>(*prot_, this->field3);
    }
    if (this->__isset.__fbthrift_get(folly::index_constant<3>())) {
      xfer += prot_->serializedFieldSize("field4", apache::thrift::protocol::T_LIST, 4);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::list<::apache::thrift::type_class::integral>, ::std::vector<::std::int32_t>>::serializedSize<false>(*prot_, this->field4);
    }
    xfer += prot_->serializedSizeStop();
    return xfer;
    THRIFT_IGNORE_ISSET_USE_WARNING_END
  }
  
  template <class Protocol_>
  uint32_t TerseOptionalLazyFoo::write(Protocol_* prot_) const {
    THRIFT_IGNORE_ISSET_USE_WARNING_BEGIN
    uint32_t xfer = 0;
    xfer += prot_->writeStructBegin("TerseOptionalLazyFoo");
    ::apache::thrift::detail::IndexWriter<Protocol_> indexWriter(prot_, xfer);
    bool previousFieldHasValue = true;
    if (this->__isset.__fbthrift_get(folly::index_constant<0>())) {
      constexpr int16_t kPrevFieldId = ::apache::thrift::detail::kSizeField.id;
      xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_LIST, 1, kPrevFieldId>(*prot_, "field1", previousFieldHasValue);
      previousFieldHasValue = true;
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::list<::apache::thrift::type_class::floating_point>, ::std::vector<double>>::write(*prot_, this->field1);
      xfer += prot_->writeFieldEnd();
    } else {
      previousFieldHasValue = false;
    }
    if (this->__isset.__fbthrift_get(folly::index_constant<1>())) {
      constexpr int16_t kPrevFieldId = 1;
      xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_LIST, 2, kPrevFieldId>(*prot_, "field2", previousFieldHasValue);
      previousFieldHasValue = true;
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::list<::apache::thrift::type_class::integral>, ::std::vector<::std::int32_t>>::write(*prot_, this->field2);
      xfer += prot_->writeFieldEnd();
    } else {
      previousFieldHasValue = false;
    }
    if (this->__isset.__fbthrift_get(folly::index_constant<2>())) {
      constexpr int16_t kPrevFieldId = 2;
      xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_LIST, 3, kPrevFieldId>(*prot_, "field3", previousFieldHasValue);
      previousFieldHasValue = true;
      indexWriter.recordFieldStart();
      if constexpr (Protocol_::kHasIndexSupport()) {
        if (prot_->protocolType() == __fbthrift_protocol_ && __fbthrift_isDeserialized_.field3.load() == ::apache::thrift::detail::LazyDeserializationState::UNTAINTED) {
          xfer += prot_->writeRaw(__fbthrift_serializedData_.field3);
          goto written_lazy_field_field3;
        }
      }
      std::as_const(*this).__fbthrift_read_field_field3();
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::list<::apache::thrift::type_class::floating_point>, ::std::vector<double>>::write(*prot_, this->field3);
      written_lazy_field_field3:
      indexWriter.recordFieldEnd(::apache::thrift::type_class::list<::apache::thrift::type_class::floating_point>{}, this->field3, 3);
      xfer += prot_->writeFieldEnd();
    } else {
      previousFieldHasValue = false;
    }
    if (this->__isset.__fbthrift_get(folly::index_constant<3>())) {
      constexpr int16_t kPrevFieldId = 3;
      xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_LIST, 4, kPrevFieldId>(*prot_, "field4", previousFieldHasValue);
      previousFieldHasValue = true;
      indexWriter.recordFieldStart();
      if constexpr (Protocol_::kHasIndexSupport()) {
        if (prot_->protocolType() == __fbthrift_protocol_ && __fbthrift_isDeserialized_.field4.load() == ::apache::thrift::detail::LazyDeserializationState::UNTAINTED) {
          xfer += prot_->writeRaw(__fbthrift_serializedData_.field4);
          goto written_lazy_field_field4;
        }
      }
      std::as_const(*this).__fbthrift_read_field_field4();
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::list<::apache::thrift::type_class::integral>, ::std::vector<::std::int32_t>>::write(*prot_, this->field4);
      written_lazy_field_field4:
      indexWriter.recordFieldEnd(::apache::thrift::type_class::list<::apache::thrift::type_class::integral>{}, this->field4, 4);
      xfer += prot_->writeFieldEnd();
    } else {
      previousFieldHasValue = false;
    }
    indexWriter.finalize();
    xfer += prot_->writeFieldStop();
    xfer += prot_->writeStructEnd();
    return xfer;
    THRIFT_IGNORE_ISSET_USE_WARNING_END
  }
  
  extern template void TerseOptionalLazyFoo::readNoXfer<>(apache::thrift::BinaryProtocolReader*);
  extern template uint32_t TerseOptionalLazyFoo::write<>(apache::thrift::BinaryProtocolWriter*) const;
  extern template uint32_t TerseOptionalLazyFoo::serializedSize<>(apache::thrift::BinaryProtocolWriter const*) const;
  extern template uint32_t TerseOptionalLazyFoo::serializedSizeZC<>(apache::thrift::BinaryProtocolWriter const*) const;
  extern template void TerseOptionalLazyFoo::readNoXfer<>(apache::thrift::CompactProtocolReader*);
  extern template uint32_t TerseOptionalLazyFoo::write<>(apache::thrift::CompactProtocolWriter*) const;
  extern template uint32_t TerseOptionalLazyFoo::serializedSize<>(apache::thrift::CompactProtocolWriter const*) const;
  extern template uint32_t TerseOptionalLazyFoo::serializedSizeZC<>(apache::thrift::CompactProtocolWriter const*) const;
  
  }}} // apache::thrift::test
  