ppsspp/Common/Data/Collections/ConstMap.h
Unknown W. Brackets 2479d52202 Global: Reduce includes of common headers.
In many places, string, map, or Common.h were included but not needed.
2022-01-30 16:35:33 -08:00

27 lines
349 B
C++

#pragma once
#include <map>
template <typename T, typename U>
class InitConstMap
{
private:
std::map<T, U> m_map;
public:
InitConstMap(const T& key, const U& val)
{
m_map[key] = val;
}
InitConstMap<T, U>& operator()(const T& key, const U& val)
{
m_map[key] = val;
return *this;
}
operator std::map<T, U>()
{
return m_map;
}
};