mirror of
https://github.com/ceph/ceph
synced 2025-01-11 13:41:02 +00:00
include/types: flat_set operator<<
Signed-off-by: Sage Weil <sage@redhat.com>
This commit is contained in:
parent
3119cf5cee
commit
1b1eec29ae
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user