Dear NG,
I have seen this code and was wondering about its meaning:
class MyClass
{
private:
typedef stl::hash_map<stl::string,
int,
FHashTraitsStringNoCase> string_2_int;
string_2_int m_String2Int;
public:
typedef string_2_int::const_iterator string_2_int_const_iterator;
// Iterate over the string_2_int
string_2_int_const_iterator BeginStringInt() const
{
return m_String2Int.begin();
}
}
The meaning of this puzzles me. What is this achieving? Hiding the
string_2_int type, but declaring an iterator to that same type to be
public, does not look like it's encapsulating anything.
Can someone please expand a bit on what is exactly happening and why
would one want to choose this approach?
Thanks,
QD