[libcxx-commits] [PATCH] D144629: [libc++] Implement LWG-3204 sub_match::swap only swaps the base class
Mark de Wever via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Fri Feb 24 08:57:04 PST 2023
Mordante added a comment.
Thanks for your patch. In general LGTM, but I would like to have a look at the changes to the test.
================
Comment at: libcxx/include/regex:5015
+
+ _LIBCPP_INLINE_VISIBILITY
+ void swap(sub_match& __s)
----------------
This is the preferred way. (At some point we probably should update the existing code base.)
================
Comment at: libcxx/include/regex:5018
+#ifndef _LIBCPP_CXX03_LANG
+_NOEXCEPT(__is_nothrow_swappable<_BidirectionalIterator>::value)
+#endif
----------------
The indention looks off.
================
Comment at: libcxx/test/std/re/re.submatch/re.submatch.members/swap.pass.cpp:25
+ sm1.first = "hello";
+ sm1.second = "world";
+ sm1.matched = true;
----------------
This looks slightly confusion, I expect `first` and `second` to point to the same range.
Can you use the ideas used in `libcxx/test/std/re/re.submatch/re.submatch.members/length.pass.cpp` ?
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D144629/new/
https://reviews.llvm.org/D144629
More information about the libcxx-commits
mailing list