CppCommon 1.0.5.0
C++ Common Library
Loading...
Searching...
No Matches
source_location.inl
Go to the documentation of this file.
1
9namespace CppCommon {
10
11inline std::ostream& operator<<(std::ostream& os, const SourceLocation& source_location)
12{
13 if ((source_location.filename() == nullptr) || (source_location.line() == 0))
14 return os;
15
16 return os << source_location.filename() << ':' << source_location.line();
17}
18
19} // namespace CppCommon
20
21#if defined(FMT_VERSION)
22template <> struct fmt::formatter<CppCommon::SourceLocation> : ostream_formatter {};
23#endif
const char * filename() const noexcept
Get file name.
int line() const noexcept
Get line number.
C++ Common project definitions.
std::ostream & operator<<(std::ostream &os, const uint128_t &value)
Definition uint128.inl:155