-
Notifications
You must be signed in to change notification settings - Fork 94
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: CPOs refactored to be more constrained #649
Conversation
@JohelEGP, is this what you meant? |
Yeah, that looks good. |
Do you think that the parameter should be unconstrained? I thought you asked me to contain it. Should those CPOs also work with |
I think it's fine to leave it constrained.
Good question, for LEWG, perhaps. |
// TODO clang-18 (and possibly other compilers) complain about the duplicated definition if `inline` is not used | ||
template<> | ||
inline constexpr bool disable_scalar<bool> = true; |
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.
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.
I believe that all variable templates are implicitly inline
. It was a recent DR, so maybe it is not implemented in Clang for now.
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.
That's true, but I don't think this is a variable template.
I can't find evidence that an explicit specialization is a template at all.
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.
Ahh, you might be right
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.
Wait, all global variables are inline
: https://cplusplus.github.io/CWG/issues/2387.html. I believe that is a bug in clang.
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.
Although, I am not sure if I understand a note:
[Note: An instantiated variable template that has const-qualified type can have external linkage, even if not declared extern. —end note]
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.
Feel free to leave it explicitly inline
.
The only case in the C++ Standard is at the end of https://eel.is/c++draft/fs.filesystem.syn.
No description provided.