Gui restable: add/remove columns

This commit is contained in:
Jean-Francois Dockes
2010-12-24 15:48:44 +01:00
parent 1e6fde221d
commit 3bd39d893e
11 changed files with 293 additions and 75 deletions
+27
View File
@@ -186,4 +186,31 @@ struct TempBuf {
#define deleteZ(X) {delete X;X = 0;}
#endif
// Code for static initialization of an stl map. Somewhat like Boost.assign.
// Ref: http://stackoverflow.com/questions/138600/initializing-a-static-stdmapint-int-in-c
// Example use: map<int, int> m = map_list_of (1,2) (3,4) (5,6) (7,8);
template <typename T, typename U>
class create_map
{
private:
std::map<T, U> m_map;
public:
create_map(const T& key, const U& val)
{
m_map[key] = val;
}
create_map<T, U>& operator()(const T& key, const U& val)
{
m_map[key] = val;
return *this;
}
operator std::map<T, U>()
{
return m_map;
}
};
#endif /* _SMALLUT_H_INCLUDED_ */