mirror of
https://github.com/yuzu-emu/yuzu-android.git
synced 2024-11-23 19:55:45 +01:00
df72480395
Now that clang-format makes [[nodiscard]] attributes format sensibly, we can apply them to several functions within the common library to allow the compiler to complain about any misuses of the functions.
23 lines
541 B
C++
23 lines
541 B
C++
// Copyright 2015 Citra Emulator Project
|
|
// Licensed under GPLv2 or any later version
|
|
// Refer to the license.txt file included.
|
|
|
|
#pragma once
|
|
|
|
#include <cstddef>
|
|
#include <utility>
|
|
#include <boost/functional/hash.hpp>
|
|
|
|
namespace Common {
|
|
|
|
struct PairHash {
|
|
template <class T1, class T2>
|
|
std::size_t operator()(const std::pair<T1, T2>& pair) const noexcept {
|
|
std::size_t seed = std::hash<T1>()(pair.first);
|
|
boost::hash_combine(seed, std::hash<T2>()(pair.second));
|
|
return seed;
|
|
}
|
|
};
|
|
|
|
} // namespace Common
|