Skip to content
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

Merged
merged 4 commits into from
Jun 3, 2022
Merged

hex: Add from_spaced_hex() #654

merged 4 commits into from
Jun 3, 2022

Conversation

chfast
Copy link
Member

@chfast chfast commented Jun 3, 2022

The from_spaced_hex() is from_hex() extension where the whitespace in the input is ignored.

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
Copy link

codecov bot commented Jun 3, 2022

Codecov Report

Merging #654 (b2b0879) into master (f4d9b41) will decrease coverage by 0.02%.
The diff coverage is 94.73%.

@@            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     

@@ -32,10 +33,19 @@ template <typename BaseIterator,
bool predicate(typename std::iterator_traits<BaseIterator>::value_type) noexcept>
struct filter_iterator
{
/// The iterators' difference type.
Copy link
Member

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

Copy link
Member Author

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".

Copy link
Member

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"

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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -83,6 +99,7 @@ struct skip_space_iterator : filter_iterator<BaseIterator, is_not_space>
using filter_iterator<BaseIterator, is_not_space>::filter_iterator;
};

/// CTAD.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a bit cryptic

Suggested change
/// CTAD.
/// Class template argument deduction guide.

Copy link
Member

@gumb0 gumb0 left a 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.
@chfast chfast merged commit 586d2c9 into master Jun 3, 2022
@chfast chfast deleted the hex_spaced branch June 3, 2022 19:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants