Open
Conversation
This comment has been minimized.
This comment has been minimized.
Member
|
Still not working for my scripting engine, the failing case is: constexpr auto name_path_def = /* please insert a suitable definition based on the type definition below */;
constexpr auto any_id_def = name_path; // <------ error
constexpr auto any_id_def = as<NamePath>(name_path); // <------ okwhere the attribute types are struct Ident { /* same as existing test case */ };
// Represents a qualified name,
// e.g. `foo::bar` is {false, {"foo", "bar"}}
// e.g. `::foo::bar` is {true, {"foo", "bar"}}
struct NamePath // adapted
{
bool is_rooted = false;
std::vector<Ident> segments;
};
struct AnyID // adapted
{
NamePath path;
}; |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
saki7
reviewed
Mar 8, 2026
Comment on lines
+181
to
+192
| auto&& unwrapped_attr = [&]() -> decltype(auto) { | ||
| if constexpr (traits::is_single_element_tuple_like<RHSAttr>::value) { | ||
| if constexpr (traits::can_hold<typename parser_traits<RHS>::attribute_type, alloy::tuple_element_t<0, RHSAttr>>::value) { | ||
| return alloy::get<0>(rhs_attr); | ||
| } else { | ||
| return rhs_attr; | ||
| } | ||
| } else { | ||
| return rhs_attr; | ||
| } | ||
| }(); | ||
|
|
Member
There was a problem hiding this comment.
Need to emit static_assert to prohibit narrowing conversion case. We want to make such case hard error as per "X3 rule problem".
This reverts commit 80ce6f0.
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.
fixes #18
based on iris-cpp/iris#54
supersedes #42
Todo
var = ident >> epsvar = as<Ident>(ident)var = identlexeme[alpha >> *alnum]gets resolved into wrong overload ofparse_sequencethat expects fusion sequence with mismatched number of elements boostorg/spirit_x4#27 is related to this PR and it must be included in the new unit testpartition_attribute's static asserts should show the actual types on compilation error #59Post-merge todo (split these into separate issues, then check)
x4::move_toX4Movablefor all combinations above (need to addressX4Movable(all overloads ofx4::move_to(src, dst)) should be SFINAE-friendly #45)single_element_tuple_like.cpp: test case yields red squiggles in IDE #72