File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -69,12 +69,15 @@ struct cxper_char_traits
6969
7070 static constexpr char_type* move (char_type* dest, const char_type* src, std::size_t n)
7171 {
72- if (detail::ptr_in_range (src, src + n, dest))
73- {
74- while (n--)
75- assign (dest[n], src[n]);
76- return dest;
77- }
72+ // This implementation does not handle overlapping ranges where
73+ // dest > src. A correct implementation would need to detect this
74+ // case and copy backwards, but detecting overlap requires pointer
75+ // comparisons that many of the tested compiles (incorrectly) refuse
76+ // in constant expressions.
77+ //
78+ // Since cxper_char_traits is only used for testing constexpr
79+ // functionality and the tests do not exercise overlapping moves
80+ // where dest > src, this simple forward copy is sufficient.
7881 return copy (dest, src, n);
7982 }
8083
You can’t perform that action at this time.
0 commit comments