-
Notifications
You must be signed in to change notification settings - Fork 49
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
Add support for C++20 concepts #166
base: master
Are you sure you want to change the base?
Conversation
Just want to say that I'm quite interested in concepts support as well. |
The doxygen compatibility problems have been resolved, but I still need test code that exhausts concepts options. Been perusing cppreference but still trying to work it out (haven't had the luxury of using c++20 in production and not enough time to catch up on my own). Questions that come up:
I'm definitely down to merge something we think covers the bases and fix it later if needed. But having code on the tests is required, it's the only reason this project still limps along. The absurd implementation is brittle and small changes elsewhere can and do break other things. Sample code would be most welcome (header file and usage examples). From there I can integrate that code into the rest of the (very complicated) testing framework. I've got some flights coming up, the last one I was able to make some good progress on updating tree view html / css. This one is also high priority for me, lack of concepts is an eyesore (it's almost 2023!) |
I apologize for completely missing your response on #160 back in June…. I can try to put in some example / testing code in the next couple of weeks or so.
Best Regards,
Andrew Lumsdaine
On Nov 20, 2022, at 10:40 AM, Stephen McDowell ***@***.******@***.***>> wrote:
The doxygen compatibility problems have been resolved, but I still need test code that exhausts concepts options. Been perusing cppreference but still trying to work it out (haven't had the luxury of using c++20 in production and not enough time to catch up on my own).
Questions that come up:
* Is there any concept inheritance?
* Can there be nested concepts (like nested classes / structs, or can a concept be declared in a nested scope like in a class definition)?
* Any other known "fancy edge cases"?
I'm definitely down to merge something we think covers the bases and fix it later if needed. But having code on the tests is required, it's the only reason this project still limps along. The absurd implementation is brittle and small changes elsewhere can and do break other things. Sample code would be most welcome (header file and usage examples). From there I can integrate that code into the rest of the (very complicated) testing framework. I've got some flights coming up, the last one I was able to make some good progress on updating tree view html / css. This one is also high priority for me, lack of concepts is an eyesore (it's almost 2023!)
—
Reply to this email directly, view it on GitHub<https://urldefense.com/v3/__https://github.com/svenevs/exhale/pull/166*issuecomment-1321210466__;Iw!!K-Hz7m0Vt54!iPD9y_1byAiuT3jWTd73k1T8geGKunvJJvMZZDcz0_ZzYPPu02uFx-fTMetoi_8q6s-rjYofWKximfRA0AFfOQ$>, or unsubscribe<https://urldefense.com/v3/__https://github.com/notifications/unsubscribe-auth/AGKPFDMOU3AVW3D6RW7MXWLWJJWDFANCNFSM5ZBLLFOQ__;!!K-Hz7m0Vt54!iPD9y_1byAiuT3jWTd73k1T8geGKunvJJvMZZDcz0_ZzYPPu02uFx-fTMetoi_8q6s-rjYofWKximfQsXwF_1Q$>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
No apology necessary, I responded very late... Ok, great, thank you so much!!! To be clear I only need help with the C++ source code, the python side / exhale test case side I will take care of 🙂 |
Thanks for the fast response. Maybe I can help a bit.
Not to my knowledge.
I don't think so. But you can combine concepts easily, like template <typename T>
concept Number = std::integral<T> || std::floating_point<T>; (Taken from https://www.sandordargo.com/blog/2021/02/24/cpp-concepts-with-classes)
According to cppreference there are three types of constraints:
So having an example per type seems to be a good start. One edge case might be the inline declaration of a concept. Although bad style it's valid: template <typename T> requires requires (T x) { x + x; }
T add(T a, T b) { return a + b; } See it on compiler explorer.. But I'm not sure how this should be documented. |
What can I do to help get this PR into a state that you'd be happy to merge @svenevs ? |
Thank you so much, I've cleared Saturday, let's keep working with #218 and #219. I will do final passes but ultimately rely on user testing. If it's working on your codebase then we merge. Fix problems if people report them. Main expected snag is getting Thank you again for putting time into this, I will get back to you as soon as I can! |
CC @lums658 refs #160 I couldn't push to that branch (I think because it's the main branch of your repo), I'm sorry for the very long delay. In order to support C++ concepts I needed to fix the testing framework for doxygen 1.9.x in order to actually test for this. This one will take me some time to flesh out entirely (there's a handful of test framework changes which would be a nightmare for not me (well for me too, but way worse for anyone else)).
However, would you be willing to add some code to the newly created
testing/projects/cpp_concepts/include/concepts/concepts.hpp
and associated usages (where applicable) insrc/tests.cpp
? Thetests.cpp
exists mostly to guarantee that anything added inconcepts.hpp
actually compiles. The infrastructure is up, but it would be really helpful to have a more exhaustive list of concepts code -- I'm not up to speed, just anything that would stress test doxygen / breathe from a documentation perspective. Note the testing code license is CC0 (please add yourself to the license at the top though!). Only other rule for code there is keep it PG-13, but otherwise the content (or docs) are less than meaningful anywhere else 😉I get the impression it would be fairly easy for you to PR to this branch with some nice modern concepts code there 🙏
There's definitely no rush ... it'll take me some time to finalize things (I anticipate CI being troublesome here), but after the code is in place I will be able to inspect the implementation / create unit tests for the project. Having the test project in place helps me look at the output of exhale and confirm it's working as desired.