On 08/11/19 18:12 -0500, Ed Smith-Rowland wrote:
As an experiment, I took a shot at implementing source_location for
C++20.?? This was mostly done in experimental but I wanted to try
adding column information.?? (The experimental version just returned
0).?? I added __builtin_COLUMN in analogy to __builtin_LINE.?? The std
version is also consteval so you get different results in some cases
wrt experimental. You can diff the two 1.cc test cases in libstdc++ to
see for yourself.
As Jonathan mentioned on IRC, we probably want a single builtin and we
want to coordinate the name with clang (__builtin_source_location?).??
But this "works" and it might make useful fodder for the next round.
Yes, I don't think we want to implement std::source_location this way
if we know we're going to change its layout later. But if the
__builtin_COLUMN part is approved then we could start using it in
std::experimental::source_location right away.