-
Notifications
You must be signed in to change notification settings - Fork 74
string_view: add modifiers API and related libcxx tests #946
Conversation
lukaszstolarczuk
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 5 of 5 files at r1, 1 of 1 files at r2.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @KFilipek)
include/libpmemobj++/string_view.hpp, line 266 at r1 (raw file):
* The behavior is undefined if n > size(). * * @param[in] n of characters to remove from the start of the view
number/count of characters to...
include/libpmemobj++/string_view.hpp, line 291 at r2 (raw file):
/** * Exchanges the view with that of v. *
redundant white space
tests/external/libcxx/string.view/string.view.modifiers/remove_prefix.pass.cpp, line 8 at r1 (raw file):
// //===----------------------------------------------------------------------===//
licenses :P
KFilipek
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 1 of 5 files at r1, 4 of 4 files at r3.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @lukaszstolarczuk)
include/libpmemobj++/string_view.hpp, line 266 at r1 (raw file):
Previously, lukaszstolarczuk (Łukasz Stolarczuk) wrote…
number/count of characters to...
Done. Now should sound natural, I want to leave 'n' as an parameter.
include/libpmemobj++/string_view.hpp, line 291 at r2 (raw file):
Previously, lukaszstolarczuk (Łukasz Stolarczuk) wrote…
redundant white space
Done.
tests/external/libcxx/string.view/string.view.modifiers/remove_prefix.pass.cpp, line 8 at r1 (raw file):
Previously, lukaszstolarczuk (Łukasz Stolarczuk) wrote…
licenses :P
Done.
Codecov Report
@@ Coverage Diff @@
## master #946 +/- ##
==========================================
+ Coverage 95.93% 95.95% +0.02%
==========================================
Files 48 48
Lines 6146 6154 +8
==========================================
+ Hits 5896 5905 +9
+ Misses 250 249 -1
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
igchor
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 1 of 5 files at r1, 4 of 4 files at r4.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @lukaszstolarczuk)
include/libpmemobj++/string_view.hpp, line 299 at r4 (raw file):
basic_string_view<CharT, Traits> &v) noexcept { const value_type *p = data_;
why not just:
std::swap(data_, v.data_);
std::swap(size_, v.size_);
?
KFilipek
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 5 of 5 files at r6.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @lukaszstolarczuk)
include/libpmemobj++/string_view.hpp, line 299 at r4 (raw file):
Previously, igchor (Igor Chorążewicz) wrote…
why not just:
std::swap(data_, v.data_); std::swap(size_, v.size_);?
Hmm, I've copied libcxx function body, but std::swap is also marked as constexpr
lukaszstolarczuk
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 1 of 4 files at r4, 1 of 5 files at r6.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @KFilipek)
include/libpmemobj++/string_view.hpp, line 266 at r1 (raw file):
Previously, KFilipek (Krzysztof Filipek) wrote…
Done. Now should sound natural, I want to leave 'n' as an parameter.
it seems good, but it does not point that it is a number/count of chars to remove (one may interpret it as a charset to remove 😉 )
KFilipek
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 4 of 5 files reviewed, 1 unresolved discussion (waiting on @KFilipek and @lukaszstolarczuk)
include/libpmemobj++/string_view.hpp, line 266 at r1 (raw file):
Previously, lukaszstolarczuk (Łukasz Stolarczuk) wrote…
it seems good, but it does not point that it is a number/count of chars to remove (one may interpret it as a charset to remove 😉 )
Done. I've changed it according to pmem::obj::string documentation
lukaszstolarczuk
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 3 of 5 files at r6, 1 of 1 files at r7.
Reviewable status:complete! all files reviewed, all discussions resolved
igchor
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 1 of 1 files at r7.
Reviewable status:complete! all files reviewed, all discussions resolved
- add remove_prefix, remove_suffix and swap for string_view
- enable tests for remove_suffix/prefix and swap methods
igchor
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 2 of 2 files at r8.
Reviewable status:complete! all files reviewed, all discussions resolved
lukaszstolarczuk
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 2 of 2 files at r8.
Reviewable status:complete! all files reviewed, all discussions resolved
This PR contains:
This change is