[libcxx-commits] [PATCH] D116808: fix __simple_view concept in std::ranges

Hui via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Sat Jan 8 12:20:07 PST 2022


huixie90 added a comment.

@Quuxplusone 
in addition to the previous comment , the suggested code is actually not correct according to the standard

  {
    bool called = false;
    auto dv = std::ranges::drop_view<SimpleView>(SimpleView{&called}, 4);
    assert(std::as_const(dv).begin() == nullptr);
    assert(!called);
    assert(dv.begin() == nullptr);
    assert(called);  // this is going to fail because according to the standard the non-const overload of begin doesn't exist if `base` is `simple-view`. so `called` will still be false here
  }


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D116808



More information about the libcxx-commits mailing list