Repository navigation
feat: constexpr support with trivial unions - #155
Draft
ChronoInferna wants to merge 2 commits into
Draft
ChronoInferna wants to merge 2 commits into
ChronoInferna wants to merge 2 commits into
Conversation
Member
|
Tip: If these features exist in Clang trunk, you could add Clang trunk to the CI by specifying: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Close #36 by implementing p3726 and p3074.
As of today, I don't think Clang has actually merged in support for those two papers, so I would appreciate some help verifying if these are valid changes or not as I can't test the new code (currently macro'd out) until that happens.
More specifically, I don't know which Clang version will actually release with trivial unions and as such might require changing the version in
config.hpp. I also don't know what the API forstd::start_lifetimeactually is, as it's in p3726 but the standard library only hasstd::start_lifetime_as.Otherwise here are the changes:
__cpp_trivial_unionmacro and defined theBEMAN_INPLACE_VECTOR_HAS_TRIVIAL_UNIONmacro inconfig.hpp.satisfy_constexprconcept to always betruewhen trivial unions are supported, allowing more constexpr usage.union_storagestruct for non-trivial types when trivial unions are available, enabling union-based storage and appropriate lifetime management.storage_fortype alias to selectunion_storagewhen trivial unions are supported, otherwise falling back to the previous logic.raw_byte_based_storageis only used when trivial unions are not available.