CppCommon  1.0.4.1
C++ Common Library
source_location.inl
Go to the documentation of this file.
1 
9 namespace CppCommon {
10 
11 inline 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)
22 template <> struct fmt::formatter<CppCommon::SourceLocation> : ostream_formatter {};
23 #endif
int line() const noexcept
Get line number.
const char * filename() const noexcept
Get file name.
C++ Common project definitions.
Definition: token_bucket.h:15
std::ostream & operator<<(std::ostream &os, const uint128_t &value)
Definition: uint128.inl:155