Skip to content
Snippets Groups Projects
Commit bb7717ca authored by Jan Trávníček's avatar Jan Trávníček
Browse files

add printing capability to ptr_vector

parent 1b1941aa
No related branches found
No related tags found
No related merge requests found
...@@ -177,6 +177,21 @@ std::ostream& operator<<(std::ostream& out, const std::vector<T>& vector) { ...@@ -177,6 +177,21 @@ std::ostream& operator<<(std::ostream& out, const std::vector<T>& vector) {
return out; return out;
} }
   
template< class T >
std::ostream& operator<<(std::ostream& out, const std::ptr_vector<T>& vector) {
out << "[";
bool first = true;
for(const T& item : vector) {
if(!first) out << ", ";
first = false;
out << item;
}
out << "]";
return out;
}
template<class T> template<class T>
struct compare<vector<T>> { struct compare<vector<T>> {
int operator()(const vector<T>& first, const vector<T>& second) const { int operator()(const vector<T>& first, const vector<T>& second) const {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment