Added nodiscard to dualkey map query

This commit is contained in:
2026-01-28 01:13:53 +02:00
parent ad53d4bba1
commit f8a5799327

View File

@@ -38,7 +38,6 @@ public:
} }
} }
// Insertion
void Insert(AKey firstKey, BKey secondKey, Value value) { void Insert(AKey firstKey, BKey secondKey, Value value) {
std::size_t firstKeyHash = std::hash<AKey>{}(firstKey); std::size_t firstKeyHash = std::hash<AKey>{}(firstKey);
std::size_t secondKeyHash = std::hash<BKey>{}(secondKey); std::size_t secondKeyHash = std::hash<BKey>{}(secondKey);
@@ -47,7 +46,7 @@ public:
std::move(value))); std::move(value)));
} }
// Indexing [[nodiscard("Discarding an expensive operation's result!")]]
std::vector<ResultPair> Query(std::optional<AKey> firstKey, std::vector<ResultPair> Query(std::optional<AKey> firstKey,
std::optional<BKey> secondKey) { std::optional<BKey> secondKey) {
bool isFirstKeyGiven = firstKey.has_value(); bool isFirstKeyGiven = firstKey.has_value();