MyGUI: Enumerator

MyGUI 3.2.2

Enumerator

Class for comfortable using of vectors with small while loop instead iterators. Performance is same as with iterators. Enumerator usage

typedef std::vector<std::string> VectorString;
typedef Enumerator<VectorString> EnumeratorVectorString;
VectorString vec;
vec.push_back("value");
//EnumeratorVectorString enum_vec(vec.begin(), vec.end());
EnumeratorVectorString enum_vec(vec);
while (enum_vec.next())
{
std::string value = enum_vec.current();
}
typedef std::pair<std::string, std::string> PairString;
typedef std::map<PairString> MapString;
MapString map;
map["key"] = "value";
//EnumeratorMapString enum_map(map.begin(), map.end());
EnumeratorMapString enum_map(map);
while (enum_map.next())
{
std::string key = enum_map.current().first;
std::string value = enum_map.current().second;
}
MyGUI::PairString
std::pair< std::string, std::string > PairString
Definition: MyGUI_Types.h:40
MyGUI::MapString
std::map< std::string, std::string > MapString
Definition: MyGUI_Types.h:38
MyGUI::VectorString
std::vector< std::string > VectorString
Definition: MyGUI_Types.h:39