include/types: flat_set operator<<

Signed-off-by: Sage Weil <sage@redhat.com>
This commit is contained in:
Sage Weil 2017-10-16 14:27:59 -05:00
parent 3119cf5cee
commit 1b1eec29ae

View File

@ -54,6 +54,8 @@ extern "C" {
#include <string>
#include <list>
#include <set>
#include <boost/container/flat_set.hpp>
#include <boost/container/flat_map.hpp>
#include <map>
#include <vector>
#include <iostream>
@ -106,6 +108,10 @@ inline ostream& operator<<(ostream& out, const list<A,Alloc>& ilist);
template<class A, class Comp, class Alloc>
inline ostream& operator<<(ostream& out, const set<A, Comp, Alloc>& iset);
template<class A, class Comp, class Alloc>
inline ostream& operator<<(ostream& out, const boost::container::flat_set<A, Comp, Alloc>& iset);
template<class A, class B, class Comp, class Alloc>
inline ostream& operator<<(ostream& out, const boost::container::flat_map<A, B, Comp, Alloc>& iset);
template<class A, class Comp, class Alloc>
inline ostream& operator<<(ostream& out, const multiset<A,Comp,Alloc>& iset);
template<class A, class B, class Comp, class Alloc>
inline ostream& operator<<(ostream& out, const map<A,B,Comp,Alloc>& m);
@ -166,6 +172,28 @@ inline ostream& operator<<(ostream& out, const set<A, Comp, Alloc>& iset) {
return out;
}
template<class A, class Comp, class Alloc>
inline ostream& operator<<(ostream& out, const boost::container::flat_set<A, Comp, Alloc>& iset) {
for (auto it = iset.begin();
it != iset.end();
++it) {
if (it != iset.begin()) out << ",";
out << *it;
}
return out;
}
template<class A, class B, class Comp, class Alloc>
inline ostream& operator<<(ostream& out, const boost::container::flat_map<A, B, Comp, Alloc>& m) {
for (auto it = m.begin();
it != m.end();
++it) {
if (it != m.begin()) out << ",";
out << it->first << "=" << it->second;
}
return out;
}
template<class A, class Comp, class Alloc>
inline ostream& operator<<(ostream& out, const multiset<A,Comp,Alloc>& iset) {
for (auto it = iset.begin();