[REFACTOR] Change CPP2_UFCS macro to work for both cases - no need for CPP2_UFCS_0#46
[REFACTOR] Change CPP2_UFCS macro to work for both cases - no need for CPP2_UFCS_0#46filipsajdak wants to merge 1 commit intohsutter:mainfrom
Conversation
Current implementation have two macros `CPP2_UFCS` and `CPP2_UFCS_0`. One for functions/methods with arguments and the other for no arguments case. There is special macro `__VA_OPT__()` that includes its argument only if `__VA_ARGS__` has more then zero arguments. In this change `CPP2_UFCS_0` is no longer needed and is removed. `CPP2_UFCS` works for both cases.
|
Thanks! This works on GCC and Clang. However, MSVC support for That said, I'll do a separate commit to put this into |
|
Interesting, https://learn.microsoft.com/en-us/cpp/build/reference/zc-preprocessor?view=msvc-170 makes it sound like |
|
@hsutter happy to help. If you have any work that you would like to have done please let me know. Currently I rely on the TODO comments. I am willing to help and can try to work on the things that matters at the moment. I am still learning the structure of the cppfront but can handle some of the tasks right a way. |
|
@filipsajdak Ah, good thing you mentioned the TODOs... Please don't worry about the TODO notes, those are mostly just reminders to myself, as I leave some placeholders for things I deliberately leave in a partial state that can be polished later, so that I can make progress on other features/work instead. As reminders to myself they're also often incomplete, because I have other context in my head about things I intend to do in that place when I come back to it. What would be useful is bug reports for problems you find as you try the compiler (thanks for those!) and missing features that you wanted yourself (such as interpolation for basic |
The current implementation has two macros
CPP2_UFCSandCPP2_UFCS_0. One for functions/methods with arguments and the other for no arguments cases. There is a special macro__VA_OPT__()that includes its argument only if__VA_ARGS__has more than zero arguments.In this change
CPP2_UFCS_0is no longer needed and is removed.CPP2_UFCSworks for both cases.pure2-stdio.cpp2
generates
compiles and run fine.