feat(scoped_map): add operator<< to scoped_map for debugging
This commit is contained in:
parent
a05b6b476e
commit
6307beedc9
1 changed files with 10 additions and 0 deletions
|
@ -142,6 +142,16 @@ public:
|
||||||
return m_map.end();
|
return m_map.end();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** \brief (For debugging) Display the content of this scoped map. */
|
||||||
|
friend std::ostream & operator<<(std::ostream & out, scoped_map const & m) {
|
||||||
|
out << "{";
|
||||||
|
for (auto e : m) {
|
||||||
|
out << e.first << " |-> " << e.second << "; ";
|
||||||
|
};
|
||||||
|
out << "}";
|
||||||
|
return out;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
\brief Auxiliary class for automatically performing a \c push
|
\brief Auxiliary class for automatically performing a \c push
|
||||||
in the constructor and a \c pop in the destructor.
|
in the constructor and a \c pop in the destructor.
|
||||||
|
|
Loading…
Reference in a new issue