You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Concepts in cpp20 have made generic programming easier but they still leave a lot to be desired, after all they are called concepts "lite" for a reason. P1900 describes some desired features from concepts. Along with those features, concepts are only that much useful as much as they used. Currently there is no mechanism to force the use of concepts too (which P1900 does not mention).
While this is not a full suggestion, it is more of a question if Herb would like a mechanism similar to C++0x concepts to be present in cpp2?
A lot of work was done on that feature, and it almost made it into the language except that it didn't (I don't know the reasons but Herb, as being someone from the commitee would probably know).
Alternatives considered : Interfaces in cpp2 could somehow emulate both nominal concepts and customisation points but features like associated types, type erasure are still left desired.
First of all, THANKS for a reply.
Second of all, they were not complicated but hard to use in the final form that was agreed upon (which Bjarne didn't like and it ultimately led to their cancellation). While most of those features would probably require something at language level, one feature that I think is essential is early definition checking of template functions. N1848 section 4 describes how that would work. Even this one I'm not sure if it can be implemented.
There's also notion of nominal concepts which are explicitly opt in. They can be easily emulated with interfaces (on cpp2 side) and std::derived_from (on cpp side) so that's one more thing.
Repository owner locked and limited conversation to collaborators on Aug 14, 2023
Activity
AbhinavK00 commentedon Aug 13, 2023
I was hoping to get some feedback to this issue. If Herb doesn't want that in cpp2, he can close but I'd like to see what his views are.
JohelEGP commentedon Aug 13, 2023
See https://youtu.be/CXn02MPkn8Y?t=176.
Apparently, C++0x concepts
AbhinavK00 commentedon Aug 13, 2023
First of all, THANKS for a reply.
Second of all, they were not complicated but hard to use in the final form that was agreed upon (which Bjarne didn't like and it ultimately led to their cancellation). While most of those features would probably require something at language level, one feature that I think is essential is early definition checking of template functions.
N1848 section 4 describes how that would work. Even this one I'm not sure if it can be implemented.
There's also notion of nominal concepts which are explicitly opt in. They can be easily emulated with interfaces (on cpp2 side) and std::derived_from (on cpp side) so that's one more thing.