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

small_vector CTAD / eliminate transfer_from_same() #50

Merged
merged 2 commits into from
Dec 13, 2023
Merged

Conversation

paulhuggett
Copy link
Owner

@paulhuggett paulhuggett commented Dec 13, 2023

  • Add a simple CTAD guide to small_vector<>.

  • Eliminate the transfer_from_same() members.

    Coverity CID1569248 is under the impression that the transfer_from_same() function could throw if the variant was storing a ype with index other than the function's Index template argument. The two being the same was, however, a precondition of calling the function.

    Since the two versions of transfer_from_same() was called only once each, I think that inlining them in the location that the precondition is established makes more sense than having them as separate functions.

Coverity CID1569248 is under the impression that the
transfer_from_same() function could throw if the variant was storing a
type with index other than the function's Index template
argument. The two being the same was, however, a precondition of the
function.

Since the two versions of transfer_from_same() was called only once
each, I think that inlining them in the location that the precondition
is established makes more sense than having them as separate functions.
Copy link

codecov bot commented Dec 13, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (d70ae27) 95.56% compared to head (5e69f0a) 95.58%.
Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #50      +/-   ##
==========================================
+ Coverage   95.56%   95.58%   +0.01%     
==========================================
  Files          35       35              
  Lines        6431     6426       -5     
==========================================
- Hits         6146     6142       -4     
+ Misses        285      284       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

@paulhuggett paulhuggett marked this pull request as ready for review December 13, 2023 16:08
@paulhuggett paulhuggett changed the title small_vector CTAD / eliminate transfer from same() small_vector CTAD / eliminate transfer_from_same() Dec 13, 2023
@paulhuggett paulhuggett merged commit d20866e into main Dec 13, 2023
39 checks passed
@paulhuggett paulhuggett deleted the sv-ctad branch December 13, 2023 17:12
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.

1 participant