-
Notifications
You must be signed in to change notification settings - Fork 314
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
hex: Add from_spaced_hex() #654
Conversation
This makes the filter_iterator.hpp a public header of EVMC libraries.
Fix constness of operator!=, operator== of filter_iterator. This also silence the C++20 -Wambiguous-reversed-operator warning.
Codecov Report
@@ Coverage Diff @@
## master #654 +/- ##
==========================================
- Coverage 93.07% 93.04% -0.03%
==========================================
Files 25 25
Lines 3654 3654
Branches 378 379 +1
==========================================
- Hits 3401 3400 -1
Misses 144 144
- Partials 109 110 +1 |
include/evmc/filter_iterator.hpp
Outdated
@@ -32,10 +33,19 @@ template <typename BaseIterator, | |||
bool predicate(typename std::iterator_traits<BaseIterator>::value_type) noexcept> | |||
struct filter_iterator | |||
{ | |||
/// The iterators' difference type. |
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.
either iterator's
or just iterator
, make it consistent with comments below
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.
This was suppose to be "two iterators' difference type".
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.
Fine with changing to "Two"
include/evmc/filter_iterator.hpp
Outdated
constexpr void operator++() noexcept | ||
{ | ||
++base; | ||
forward_to_next_value(); | ||
} | ||
|
||
constexpr bool operator!=(const filter_iterator& o) const noexcept { return base != o.base; } | ||
/// The equal operator. |
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.
I think it should be "equality"/"inequality" operator
https://docs.microsoft.com/en-us/cpp/cpp/equality-operators-equal-equal-and-exclpt-equal?view=msvc-170
include/evmc/filter_iterator.hpp
Outdated
@@ -83,6 +99,7 @@ struct skip_space_iterator : filter_iterator<BaseIterator, is_not_space> | |||
using filter_iterator<BaseIterator, is_not_space>::filter_iterator; | |||
}; | |||
|
|||
/// CTAD. |
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.
a bit cryptic
/// CTAD. | |
/// Class template argument deduction guide. |
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.
Looks good, only minor suggestions in comments.
The from_spaced_hex() is from_hex() extension where the whitespace in the input is ignored.
The
from_spaced_hex()
isfrom_hex()
extension where the whitespace in the input is ignored.