summaryrefslogtreecommitdiff
path: root/Source/Core/Common/Projection.h
blob: d57150813491346a27d9e2faf5bb63305203e794 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// Copyright 2025 Dolphin Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later

#include <utility>

namespace Common::Projection
{
struct First
{
  // TODO C++23: static operator()
  template <class T>
  [[nodiscard]] constexpr auto&& operator()(T&& t) const noexcept
  {
    return std::forward<T>(t).first;
  }
};

struct Second
{
  // TODO C++23: static operator()
  template <class T>
  [[nodiscard]] constexpr auto&& operator()(T&& t) const noexcept
  {
    return std::forward<T>(t).second;
  }
};

using Key = First;
using Value = Second;
}  // namespace Common::Projection