docs: document location

This commit is contained in:
2026-06-02 12:30:18 +02:00
parent 72dc7777fb
commit 1f4d0b992d
+18 -3
View File
@@ -6,15 +6,30 @@
namespace furc {
/**
* @brief A location in file.
*/
struct location {
std::string_view filename;
std::size_t line = 0;
std::size_t column = 0;
std::string_view filename; /**< File's name */
std::size_t line = 0; /**< Line */
std::size_t column = 0; /**< Column */
/**
* @brief Compare two locations for equality.
*
* @param rhs Location to compare against.
* @return true if the locations are equal.
*/
bool operator==(const location& rhs) const {
return filename == rhs.filename && line == rhs.line && column == rhs.column;
}
/**
* @brief Compare two locations for inequality.
*
* @param rhs Location to compare against.
* @return true if the locations are not equal.
*/
bool operator!=(const location& rhs) const { return !this->operator==(rhs); }
};