[libcxx-commits] [PATCH] D126616: [libc++] Implement ranges::move{, _backward}
Nikolas Klauser via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Sat Jun 11 13:28:04 PDT 2022
philnik added inline comments.
================
Comment at: libcxx/include/__algorithm/move.h:49
+#ifndef _LIBCPP_COMPILER_GCC
+ && !is_trivially_copyable<_InValueT>::value
+#endif
----------------
var-const wrote:
> philnik wrote:
> > var-const wrote:
> > > Can you provide a bit more context about this workaround?
> > What are you asking about exactly? Why I have to check for `is_trivially_copyable`? That's because `__builtin_memmove` requires the type to be trivially_copable. Or do you mean something else?
> I'm asking about the preprocessor guard, why the check is only done if the compiler is not GCC.
GCC currently doesn't support `__builtin_memmove` during constant evaluation, so we have to fall back to the naive implementation.
================
Comment at: libcxx/test/std/algorithms/alg.modifying.operations/alg.move/ranges.move.pass.cpp:113
+ test_in_iterators<cpp20_output_iterator<int*>>();
+ test_in_iterators<cpp20_input_iterator<int*>>();
+ test_in_iterators<forward_iterator<int*>>();
----------------
var-const wrote:
> Can you please add a brief comment explaining why `cpp17_input_iterator` doesn't work?
Because I forgot to add it :P
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D126616/new/
https://reviews.llvm.org/D126616
More information about the libcxx-commits
mailing list