News for hackers. Stuff that matters.
Re:Is the preprocessor still needed in C++? (2017) by MauranKilom on Sunday December 06, 2020 @07:54AM (#25323201)
Presumably it would become

  auto loc = std::source_location::current();
at some point, which seems fair enough to me.
Re:Is the preprocessor still needed in C++? (2017) by jpz on Sunday December 06, 2020 @08:53AM (#25323448)
I 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.

Re:Is the preprocessor still needed in C++? (2017) by unglaublich on Sunday December 06, 2020 @08:50AM (#25323441)
It 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++.
Re:Is the preprocessor still needed in C++? (2017) by Aardwolf on Sunday December 06, 2020 @08:55AM (#25323457)
I 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.

Re:Is the preprocessor still needed in C++? (2017) by identity0 on Sunday December 06, 2020 @10:35AM (#25324122)
auto in function signatures is just really, really stupid.