3 ms·
> The function std::experimental::source_location::current() expands to the information about the source file at the point of writing it. Hmm, okay, and what h
by yongjik 10y ago
> The function std::experimental::source_location::current() expands to the information about the source file at the point of writing it.
Hmm, okay, and what happens when someone puts that thing in a macro?
Some macros can be horribly ugly, but I'm not sure replacing __FILE__ with compiler-supported magic is an improvement.
- WalterBright 10y ago> replacing __FILE__ with compiler-supported magic D doesn't have a preprocessor, and so that's just what it does: http://dlang.org/spec/traits.html#specialkeywords http://dlang.org/spec/traits.html#specialkeywords
- gpderetta 10y agoThe use case for source_location is as a default value of a (function or template) parameter. BTW, __FILE__ is compiler supported magic (well, preprocessor, but they are the same thing).