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

Add full constexpr support for small_vector and small_string #38

Merged
merged 5 commits into from
Dec 11, 2022
Merged

Conversation

cschreib
Copy link
Member

@cschreib cschreib commented Dec 11, 2022

This PR does the following:

  • Remove un-initialised data in small_vector and small_string, which removes all chances of undefined behavior (UB). The potential UB was preventing these classes from being used in constexpr settings. Closes small_string cannot be used in constexpr expression if string isn't full #17.
  • When exceptions are disabled, all REQUIRE*() and FAIL() macros will call std::terminate instead of return, to ensure no further code in the test case is executed.

@codecov-commenter
Copy link

codecov-commenter commented Dec 11, 2022

Codecov Report

Merging #38 (eddc563) into main (4f69528) will not change coverage.
The diff coverage is n/a.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main      #38   +/-   ##
=======================================
  Coverage   92.96%   92.96%           
=======================================
  Files           2        2           
  Lines         981      981           
=======================================
  Hits          912      912           
  Misses         69       69           
Impacted Files Coverage Δ
include/snatch/snatch.hpp 96.11% <ø> (ø)
src/snatch.cpp 91.33% <ø> (ø)

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 4f69528...eddc563. Read the comment docs.

@cschreib cschreib merged commit 4877eb7 into main Dec 11, 2022
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.

small_string cannot be used in constexpr expression if string isn't full
2 participants