aboutsummaryrefslogtreecommitdiff
path: root/boot/result.cc
diff options
context:
space:
mode:
Diffstat (limited to 'boot/result.cc')
-rw-r--r--boot/result.cc10
1 files changed, 6 insertions, 4 deletions
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<diagnostic_note> identifier_list_note(
const std::vector<identifier>& 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<char, shortest_round_trip + 4> 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<elna::boot::constant_aggregate<std::vector>>::operator()(
const elna::boot::constant_aggregate<std::vector>& 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<elna::boot::constant_aggregate<elna::boot::ordered_map>>::
const elna::boot::constant_aggregate<elna::boot::ordered_map>& 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<std::string>{}(element.first) + hasher(element.second);
});