From f7b035a505e86ad916a43ab1dc1a662a6066b011 Mon Sep 17 00:00:00 2001 From: Eugen Wissner Date: Thu, 24 Sep 2026 00:39:51 +0200 Subject: Move module heading to the top --- boot/result.cc | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'boot/result.cc') diff --git a/boot/result.cc b/boot/result.cc index c8ea267..71326c0 100644 --- a/boot/result.cc +++ b/boot/result.cc @@ -131,7 +131,7 @@ namespace elna::boot std::optional identifier_list_note( const std::vector& identifiers) { - auto position_span = source_position(identifiers.front().position().start(), + const source_position position_span = source_position(identifiers.front().position().start(), identifiers.back().position().end()); return diagnostic_note{ .message = join(identifiers), .position = position_span, .file = {} }; @@ -501,7 +501,7 @@ namespace elna::boot constexpr std::size_t shortest_round_trip = 24; std::array buffer; - auto float_chars = std::to_chars(buffer.begin(), buffer.end(), this->raw); + const std::to_chars_result float_chars = std::to_chars(buffer.begin(), buffer.end(), this->raw); return std::string(buffer.begin(), float_chars.ptr); } @@ -557,7 +557,8 @@ std::size_t std::hash>::operator()( const elna::boot::constant_aggregate& key) const noexcept { const elna::boot::constant_value_hash hasher{}; - auto hash = std::accumulate(key->begin(), key->end(), elna::boot::hash_accumulator{}, + const elna::boot::hash_accumulator hash = std::accumulate(key->begin(), key->end(), + elna::boot::hash_accumulator{}, [&hasher](const auto& accumulator, const auto& element) { return accumulator + hasher(element); }); @@ -569,7 +570,8 @@ std::size_t std::hash>:: const elna::boot::constant_aggregate& key) const noexcept { const elna::boot::constant_value_hash hasher{}; - auto hash = std::accumulate(key->begin(), key->end(), elna::boot::hash_accumulator{}, + const elna::boot::hash_accumulator hash = std::accumulate(key->begin(), key->end(), + elna::boot::hash_accumulator{}, [&hasher](const auto& accumulator, const auto& element) { return accumulator + std::hash{}(element.first) + hasher(element.second); }); -- cgit v1.2.3