Page MenuHomePhabricator

[libc++] Implement the output_iterator and output_range concepts

Authored by ldionne on Jul 23 2021, 1:14 PM.

Diff Detail

Unit TestsFailed

4,600 mslibcxx CI Windows (DLL) > libc++.libcxx/ranges/range_nonprop_cache::has_value.pass.cpp
Script: -- : 'COMPILED WITH'; "C:/Program Files/LLVM/bin\clang++.EXE" C:\ws\w32-1\llvm-project\libcxx-ci\libcxx\test\libcxx\ranges\range.nonprop.cache\has_value.pass.cpp -v --target=x86_64-pc-windows-msvc -nostdinc++ -IC:/ws/w32-1/llvm-project/libcxx-ci/build/windows-dll/include/c++/v1 -IC:/ws/w32-1/llvm-project/libcxx-ci/build/windows-dll\include\c++build -IC:/ws/w32-1/llvm-project/libcxx-ci/libcxx\test/support -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_STDIO_ISO_WIDE_SPECIFIERS -DNOMINMAX -D_LIBCPP_HAS_NO_INT128 -std=c++2b -Werror -Wall -Wextra -Wshadow -Wundef -Wno-unused-command-line-argument -Wno-attributes -Wno-pessimizing-move -Wno-c++11-extensions -Wno-user-defined-literals -Wno-noexcept-type -Wno-atomic-alignment -Wsign-compare -Wunused-variable -Wunused-parameter -Wunreachable-code -Wno-unused-local-typedef -D_LIBCPP_DISABLE_AVAILABILITY -fcoroutines-ts -Werror=thread-safety -Wuser-defined-warnings -D_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER -Wno-macro-redefined -D_LIBCPP_ABI_VERSION=1 -L C:\BuildTools\VC\Tools\MSVC\14.28.29910\ATLMFC\lib\x64 -L C:\BuildTools\VC\Tools\MSVC\14.28.29910\lib\x64 -L "C:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\lib\um\x64" -L "C:\Program Files (x86)\Windows Kits\10\lib\10.0.19041.0\ucrt\x64" -L "C:\Program Files (x86)\Windows Kits\10\lib\10.0.19041.0\um\x64" -LC:/ws/w32-1/llvm-project/libcxx-ci/build/windows-dll/lib -LC:/ws/w32-1/llvm-project/libcxx-ci/build/windows-dll/lib -nodefaultlibs -nostdlib -lc++ -lvcruntime -lucrt -lmsvcrt -lmsvcprt -loldnames -o C:\ws\w32-1\llvm-project\libcxx-ci\build\windows-dll\test\libcxx\ranges\range.nonprop.cache\Output\has_value.pass.cpp.dir\t.tmp.exe

Event Timeline

ldionne requested review of this revision.Jul 23 2021, 1:14 PM
ldionne created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptJul 23 2021, 1:14 PM
Herald added a reviewer: Restricted Project. · View Herald Transcript
ldionne updated this revision to Diff 361323.Jul 23 2021, 1:16 PM

Update RangeStatus paper, and move author to "Various" since they were implemented in various patches by various people.

Quuxplusone accepted this revision as: Quuxplusone.Jul 23 2021, 2:54 PM
Quuxplusone added a subscriber: Quuxplusone.

LGTM mod comments.


Is iter_value_t in the "dependencies" column? I'd think that things that have been completed don't need to mention their dependencies anymore.
Honestly, things that have been completed don't need to mention their authors anymore; but I know this could be perceived as me complaining about other people getting internet points only because I myself have zero internet points at the moment. ;)


As usual, I think it would be nice to use static_cast<_Tp&&>(__t) here, but I don't object if we're not doing that (yet).


Might drive-by condense these >>s.


+2 spaces here to match indentation below


// Not satisfied when we can't assign a T to the result of *it
would be clearer as re parallel construction with line 39. It took me a while to figure out what was going on here.
Admittedly, that was because I fixated on the void operator++(int) on line 42. Consider making that something like const T *operator++(int) — i.e., you should work in the entire expression *it++ = T(), don't just make *it++ ill-formed by itself.

Mordante accepted this revision.Jul 24 2021, 5:02 AM
Mordante added a subscriber: Mordante.

Thanks for working on this!
LGTM modulo some nits.


For consistency with the code above, please add a space after the opening parenthesis.


For consistency with the code above, please add a space after the opening parenthesis.

This revision is now accepted and ready to land.Jul 24 2021, 5:02 AM
ldionne marked 7 inline comments as done.Jul 26 2021, 8:04 AM
ldionne added inline comments.

We're not. If we do that, we can do it across the library and document it somewhere. I don't want to start doing it as one-offs, since that's just creating inconsistency.


Will do in a separate NFC commit.

ldionne updated this revision to Diff 361664.Jul 26 2021, 8:05 AM
ldionne marked 2 inline comments as done.

Address review comments

cjdb added a subscriber: cjdb.Jul 27 2021, 9:25 AM

Thanks for implementing this! It somehow slipped by me, but I have two bits of feedback:

  • please update all iterator concept conformance tests
  • please update all range concept conformance tests