[all-commits] [llvm/llvm-project] ceff0b: [libc++] Do not require movability in __non_propag...
Louis Dionne via All-commits
all-commits at lists.llvm.org
Tue Aug 17 08:33:02 PDT 2021
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: ceff0b7258aefc6e5299802c119b3d01545440f4
https://github.com/llvm/llvm-project/commit/ceff0b7258aefc6e5299802c119b3d01545440f4
Author: Louis Dionne <ldionne.2 at gmail.com>
Date: 2021-08-17 (Tue, 17 Aug 2021)
Changed paths:
M libcxx/include/__ranges/drop_view.h
M libcxx/include/__ranges/join_view.h
M libcxx/include/__ranges/non_propagating_cache.h
M libcxx/include/__ranges/reverse_view.h
M libcxx/test/libcxx/ranges/range.nonprop.cache/assign.copy.pass.cpp
M libcxx/test/libcxx/ranges/range.nonprop.cache/assign.move.pass.cpp
M libcxx/test/libcxx/ranges/range.nonprop.cache/ctor.copy.pass.cpp
M libcxx/test/libcxx/ranges/range.nonprop.cache/ctor.move.pass.cpp
M libcxx/test/libcxx/ranges/range.nonprop.cache/deref.pass.cpp
A libcxx/test/libcxx/ranges/range.nonprop.cache/emplace.pass.cpp
A libcxx/test/libcxx/ranges/range.nonprop.cache/emplace_from.pass.cpp
M libcxx/test/libcxx/ranges/range.nonprop.cache/has_value.pass.cpp
Log Message:
-----------
[libc++] Do not require movability in __non_propagating_cache::__emplace_deref
As explained in http://eel.is/c++draft/range.nonprop.cache#note-1, we
should allow copy and move elision to happen when calling emplace_deref
in non-propagating-cache. Before this change, the only way to emplace
into the non-propagating-cache was to call `__set(*it)`, which materialized
`*it` when binding it to the reference argument of `__set` and disabled
move elision.
As a fly-by change, this also renames `__set` to `__emplace` for consistency
and adds tests for it.
Differential Revision: https://reviews.llvm.org/D107932
More information about the All-commits
mailing list