There are some predefined preprocessor macros (specified in C and C++ standard) like __line__
and __file__
which are replaced by line number and file name during preprocessing respectively. In C++20, a new class std::source_location
is introduced which does more or less the same thing.
So, my questions are...
- What are the differences between them?
- What are their advantages and disadvantages?
- Which one I should use for which reason?