Closed tigran2008 closed 4 months ago
Review changes with SemanticDiff.
I'm so sorry for the mistakes, I'm a total beginner to C++ and I'm trying my best :/
After I'm done, I promise I'll squash the commits 😅
You can run the unit tests locally if you want to check before you push, though it does take some time to do all C++11/14/17/20 variants.
Do you think this implementation of etl::nullptr_t is acceptable? It instantiates a _nullptr
instance beforehand, and it occupies one byte of storage, unlike the previous one, which didn't occupy any (without usage). I could also do #define ETL_NULLPTR (etl::nullptr())
but I thought it wouldn't be good to instantiate a new object everywhere a nullptr is used..
Also, if you do think it's an acceptable solution, do you think I should add a (void)_nullptr; // silence unused warning
? I didn't get an unused variable warning on my computer (gcc version 13.3.1 20240522 (Red Hat 13.3.1-1) (GCC) on Fedora 39) but I just noticed that it warns on https://cpp.sh
Do you think I should also delete etl::addressof(ETL_NULLPTR)?
Well, I'll be waiting for a comment from you before squashing the commits
I'll have a look tomorrow.
Well, the title is self-explanatory. This is a tiny change anyway, and the code is basically what's proposed in #922.
Edit: As of this moment, I changed the pre-C++11 code from an enum into a custom class