3 ms·
Presumably it would become auto loc = std::source_location::current(); at some point, which seems fair enough to me.
by MauranKilom 6y ago
Presumably it would become
auto loc = std::source_location::current();
at some point, which seems fair enough to me.
- unglaublich 6y agoIt is since C++20. Comment author tries to make code verbose to make their point or does not know about auto and the state of C++.
- Aardwolf 6y agoI simply copied it from the article (minus the surrounding function). Fortunately you only need to write this at the utility function, not at every call site, so it's ok. In general I find various new features in C++ suffer from verbosity, but of course without experimental this one gets better.
- identity0 6y agoauto in function signatures is just really, really stupid.
- jpz 6y agoI mean, don't love the macros - but that still looks like a load of typing to me - and it even reads less well than __LINE__ if you are looking at from a literate programming perspective. It's tidier for the compiler though, but the change does not seem to make it easier for the reader of the code to comprehend.