[libcxx-commits] [PATCH] D101183: [libc++] Make sure __bit_iterator does not use deprecated SMF generation

Arthur O'Dwyer via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Fri Apr 23 12:21:09 PDT 2021


Quuxplusone requested changes to this revision.
Quuxplusone added a comment.
This revision now requires changes to proceed.

You probably saw my Slack, but for the record, I think we want this:

  public:
      _LIBCPP_INLINE_VISIBILITY __bit_iterator() _NOEXCEPT
  #if _LIBCPP_STD_VER > 11
      : __seg_(nullptr), __ctz_(0)
  #endif
      {}
      // When _IsConst=false, this is the copy constructor.
      // It is non-trivial. We maintain this for ABI purposes.
      _LIBCPP_INLINE_VISIBILITY
      __bit_iterator(const __bit_iterator<_Cp, false>& __it) _NOEXCEPT
          : __seg_(__it.__seg_), __ctz_(__it.__ctz_) {}
      // When _IsConst=false, we have a user-provided copy constructor,
      // so we must also provide a copy assignment operator because
      // the implicit generation of a defaulted one is deprecated.
      _LIBCPP_INLINE_VISIBILITY
      __bit_iterator& operator=(const _If<_IsConst, struct __private_nat, __bit_iterator>& __it) {
          __seg_ = __it.__seg_;
          __ctz_ = __it.__ctz_;
          return *this;
      }
      _LIBCPP_INLINE_VISIBILITY reference operator*() const _NOEXCEPT
          {return reference(__seg_, __storage_type(1) << __ctz_);}


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D101183/new/

https://reviews.llvm.org/D101183



More information about the libcxx-commits mailing list