21 #ifndef otbJoinContainer_h
22 #define otbJoinContainer_h
29 #include <boost/range/begin.hpp>
30 #include <boost/range/end.hpp>
31 #include <boost/range/empty.hpp>
46 template <
typename TRange>
47 inline std::ostream&
Join(std::ostream& os, TRange
const& range, std::string
const& separator)
49 if (!boost::empty(range))
51 typename boost::range_iterator<TRange const>::type first = boost::begin(range);
52 typename boost::range_iterator<TRange const>::type
const last = boost::end(range);
54 for (++first; first != last; ++first)
56 os << separator << *first;
73 template <
typename Tmap>
74 inline std::ostream&
JoinMap(std::ostream& os, Tmap
const& range, std::string
const& separator)
76 if (!boost::empty(range))
78 typename boost::range_iterator<Tmap const>::type first = boost::begin(range);
79 typename boost::range_iterator<Tmap const>::type
const last = boost::end(range);
81 for (++first; first != last; ++first)
83 os << separator << first->second;
91 #ifndef OTB_MANUAL_INSTANTIATION
95 #endif // otbJoinContainer_h