fix up gripes in source_location

* get rid of columns we dont need those
pull/1638/head
Jeff Becker 3 years ago
parent acdb8a19a6
commit 7d07dea235
No known key found for this signature in database
GPG Key ID: F357B3B42F6F9B05

@ -13,15 +13,9 @@ namespace slns
current(
const char* fileName = __builtin_FILE(),
const char* functionName = __builtin_FUNCTION(),
const uint_least32_t lineNumber = __builtin_LINE(),
#if defined(__GNUC__) and (__GNUC__ > 4 or (__GNUC__ == 4 and __GNUC_MINOR__ >= 8))
const uint_least32_t columnOffset = 0)
#else
const uint_least32_t columnOffset = __builtin_COLUMN())
#endif
noexcept
const uint_least32_t lineNumber = __builtin_LINE()) noexcept
{
return source_location{fileName, functionName, lineNumber, columnOffset};
return source_location{fileName, functionName, lineNumber};
}
source_location(const source_location&) = default;
@ -45,28 +39,15 @@ namespace slns
return lineNumber;
}
constexpr std::uint_least32_t
column() const noexcept
{
return columnOffset;
}
private:
constexpr explicit source_location(
const char* fileName,
const char* functionName,
const uint_least32_t lineNumber,
const uint_least32_t columnOffset) noexcept
: fileName(fileName)
, functionName(functionName)
, lineNumber(lineNumber)
, columnOffset(columnOffset)
const char* fileName, const char* functionName, const uint_least32_t lineNumber) noexcept
: fileName(fileName), functionName(functionName), lineNumber(lineNumber)
{}
const char* fileName;
const char* functionName;
const std::uint_least32_t lineNumber;
const std::uint_least32_t columnOffset;
const char* const fileName;
const char* const functionName;
const uint_least32_t lineNumber;
};
} // namespace slns
#endif

Loading…
Cancel
Save