2015-04-29 15:50:57 -04:00
|
|
|
#ifndef ISAAC_TOOLS_MAKE_MAP_HPP
|
2015-08-05 09:24:10 -07:00
|
|
|
#define ISAAC_TOOLS_MAKE_MAP_HPP
|
2015-01-12 13:20:53 -05:00
|
|
|
|
|
|
|
#include <vector>
|
|
|
|
|
2015-04-29 15:50:57 -04:00
|
|
|
namespace isaac
|
2015-01-12 13:20:53 -05:00
|
|
|
{
|
|
|
|
|
|
|
|
namespace tools
|
|
|
|
{
|
|
|
|
|
|
|
|
template<typename MapT>
|
|
|
|
class make_map
|
|
|
|
{
|
|
|
|
typedef typename MapT::key_type T;
|
|
|
|
typedef typename MapT::mapped_type U;
|
|
|
|
public:
|
|
|
|
make_map(const T& key, const U& val)
|
|
|
|
{
|
|
|
|
map_.insert(std::make_pair(key,val));
|
|
|
|
}
|
|
|
|
|
|
|
|
make_map<MapT>& operator()(const T& key, const U& val)
|
|
|
|
{
|
|
|
|
map_.insert(std::make_pair(key,val));
|
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
|
|
|
|
operator MapT()
|
|
|
|
{
|
|
|
|
return map_;
|
|
|
|
}
|
|
|
|
private:
|
|
|
|
MapT map_;
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|