diff --git a/Source/Core/Common/CMakeLists.txt b/Source/Core/Common/CMakeLists.txt index 8f3eeb0a27..c368cde1d6 100644 --- a/Source/Core/Common/CMakeLists.txt +++ b/Source/Core/Common/CMakeLists.txt @@ -114,6 +114,7 @@ add_library(common PcapFile.h Profiler.cpp Profiler.h + Projection.h QoSSession.cpp QoSSession.h Random.cpp diff --git a/Source/Core/Common/Projection.h b/Source/Core/Common/Projection.h new file mode 100644 index 0000000000..d571508134 --- /dev/null +++ b/Source/Core/Common/Projection.h @@ -0,0 +1,30 @@ +// Copyright 2025 Dolphin Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later + +#include + +namespace Common::Projection +{ +struct First +{ + // TODO C++23: static operator() + template + [[nodiscard]] constexpr auto&& operator()(T&& t) const noexcept + { + return std::forward(t).first; + } +}; + +struct Second +{ + // TODO C++23: static operator() + template + [[nodiscard]] constexpr auto&& operator()(T&& t) const noexcept + { + return std::forward(t).second; + } +}; + +using Key = First; +using Value = Second; +} // namespace Common::Projection diff --git a/Source/Core/DolphinLib.props b/Source/Core/DolphinLib.props index 367c347213..61cf4eddaa 100644 --- a/Source/Core/DolphinLib.props +++ b/Source/Core/DolphinLib.props @@ -144,6 +144,7 @@ +