-
Notifications
You must be signed in to change notification settings - Fork 284
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
refactor: use concepts more #5537
refactor: use concepts more #5537
Conversation
Windows build looks like it's failing to import vcpkg
|
ahhhhhh outdated android libc++ version https://stackoverflow.com/questions/75942918/expected-concept-name-with-optional-arguments |
@OrenAudeles fixed in |
nice, android build succeeded and since Windows build hasn't died from vcpkg it'll probably be okay. Once all of the builds finish it's probably okay to call it ready. TBH I'm not familiar enough with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks to be building fine, and only have the one question below because I'm not familiar with how JSON loading templatey stuff works other than "it just works"(tm).
src/generic_factory.h
Outdated
template < typename MemberType, typename ReaderType, typename DefaultType = MemberType, | ||
typename = typename std::enable_if < | ||
!std::is_constructible<MemberType, const ReaderType &>::value >::type > | ||
template<typename MemberType, typename ReaderType> requires SupportsReader<MemberType, ReaderType> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does the requires SupportsReader<...>
here negate the requirement for the enable_if<is_constructible<...>>
in the earlier default value optional
implementation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
err wait no i don't think so, lemme write a fix real quick
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done in a23cd22
(#5537), this one can be trusted because it's auto-migrated with clang-tidy. also #5540 because std::same_as
is removed, preventing this error from happening
d8ba955
to
a23cd22
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good
Checklist
Required
main
so it won't cause conflict when updatingmain
branch later.Purpose of change
followup to #5514; concept is easier to understand than SNIFAE, let's use them more!
Describe the solution
check individual commits for details.
Describe alternatives you've considered
use less overloading trickery and just use different name for
optional
?Testing
compiled in my machine (tm) but need to check if the concepts translation is correct because they're done 100% manually
Additional context
i'm dumdum and found this after i've done it manually: https://clang.llvm.org/extra/clang-tidy/checks/modernize/use-constraints.html