CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
hrydgard

CoCalc provides the best real-time collaborative environment for Jupyter Notebooks, LaTeX documents, and SageMath, scalable from individual users to large groups and classes!

GitHub Repository: hrydgard/ppsspp
Path: blob/master/Common/Data/Collections/ConstMap.h
Views: 1401
1
#pragma once
2
3
#include <map>
4
5
template <typename T, typename U>
6
class InitConstMap
7
{
8
private:
9
std::map<T, U> m_map;
10
public:
11
InitConstMap(const T& key, const U& val)
12
{
13
m_map[key] = val;
14
}
15
16
InitConstMap<T, U>& operator()(const T& key, const U& val)
17
{
18
m_map[key] = val;
19
return *this;
20
}
21
22
operator std::map<T, U>()
23
{
24
return m_map;
25
}
26
};
27
28