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

[MISC] Remove std::ranges::copy and std::cpp20::back_inserter. #54

Merged
merged 2 commits into from
Feb 3, 2022

Conversation

smehringer
Copy link
Member

@smehringer smehringer commented Jan 24, 2022

Follow up of #44

Most changes are euqivalent because we don't need e.g. std::ranges::find if we have a common range anyway. IMHO this change even became more readable.

The only not nice change is this one

+    std::string str = [&range] () { std::string s; for (auto c : range) s.push_back(c); return s; }();
-    std::string str;
-    std::ranges::copy(range, std::cpp20::back_inserter(str));

because it is in the snippets and thus code that is exposed to the user.
We might want to think about adding the std/ranges module to the sharg parser or drop gcc-9 support which would make #include <ranges> available directly. Then we can change this back.

@vercel
Copy link

vercel bot commented Jan 24, 2022

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/seqan/sharg-parser/8FBjdiB5mv1nuEXkPFe3oiLrjBfK
✅ Preview: https://sharg-parser-git-fork-smehringer-cpp20backinserter-seqan.vercel.app

@codecov
Copy link

codecov bot commented Jan 24, 2022

Codecov Report

Merging #54 (877b5ea) into master (a3dedd1) will increase coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #54      +/-   ##
==========================================
+ Coverage   95.22%   95.23%   +0.01%     
==========================================
  Files          13       13              
  Lines         921      923       +2     
==========================================
+ Hits          877      879       +2     
  Misses         44       44              
Impacted Files Coverage Δ
include/sharg/argument_parser.hpp 97.53% <100.00%> (ø)
include/sharg/detail/format_help.hpp 89.47% <100.00%> (+0.18%) ⬆️
include/sharg/validators.hpp 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a3dedd1...877b5ea. Read the comment docs.

@smehringer smehringer requested review from a team and Irallia and removed request for a team February 1, 2022 09:30
Copy link
Contributor

@Irallia Irallia left a comment

Choose a reason for hiding this comment

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

LGFM, thank you!

@Irallia Irallia requested review from a team and eseiler and removed request for a team February 1, 2022 11:47
@eseiler eseiler merged commit 8170226 into seqan:master Feb 3, 2022
@smehringer smehringer deleted the cpp20_back_inserter branch February 25, 2022 08:13
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.

3 participants