typedefRingIteratorImpl<std::vector<QLineString*>::iterator,QPoint>RingIterator;typedefRingIteratorImpl<std::vector<QLineString*>::const_iterator,constQPoint>ConstRingIterator;namespaceboost{// Specialize metafunctions. We must include the range.hpp header.// We must open the 'boost' namespace.template<>structrange_iterator<QRing>{typedefRingIteratortype;};template<>structrange_const_iterator<QRing>{typedefConstRingIteratortype;};}// namespace 'boost'// The required Range functions. These should be defined in the same namespace// as Ring.inlineRingIteratorrange_begin(QRing&r){returnRingIterator(r.lines.begin());}inlineConstRingIteratorrange_begin(constQRing&r){returnConstRingIterator(r.lines.begin());}inlineRingIteratorrange_end(QRing&r){returnRingIterator(r.lines.end());}inlineConstRingIteratorrange_end(constQRing&r){returnConstRingIterator(r.lines.end());}

typedefPolyRingIterator<std::vector<QRing*>::iterator,QRing>PolygonRingIterator;typedefPolyRingIterator<std::vector<QRing*>::const_iterator,constQRing>ConstPolygonRingIterator;classCustomPolygonRingRange{PolygonRingIterator_begin;PolygonRingIterator_end;boolisIterSet;ConstPolygonRingIterator_cbegin;ConstPolygonRingIterator_cend;boolisCIterSet;public:CustomPolygonRingRange(PolygonRingIteratorbegin,PolygonRingIteratorend):_begin(begin),_end(end),isIterSet(true){}CustomPolygonRingRange(ConstPolygonRingIteratorbegin,ConstPolygonRingIteratorend):_cbegin(begin),_cend(end),isCIterSet(true){}PolygonRingIteratorbegin(){assert(isIterSet);return_begin;}ConstPolygonRingIteratorcbegin()const{assert(isCIterSet);return_cbegin;}PolygonRingIteratorend(){assert(isIterSet);return_end;}ConstPolygonRingIteratorcend()const{assert(isCIterSet);return_cend;}};namespaceboost{// Specialize metafunctions. We must include the range.hpp header.// We must open the 'boost' namespace.template<>structrange_iterator<CustomPolygonRingRange>{typedefPolygonRingIteratortype;};template<>structrange_const_iterator<CustomPolygonRingRange>{typedefConstPolygonRingIteratortype;};}// namespace 'boost'// The required Range functions. These should be defined in the same namespace// as Ring.inlinePolygonRingIteratorrange_begin(CustomPolygonRingRange&r){returnr.begin();}inlineConstPolygonRingIteratorrange_begin(constCustomPolygonRingRange&r){returnr.cbegin();}inlinePolygonRingIteratorrange_end(CustomPolygonRingRange&r){returnr.end();}inlineConstPolygonRingIteratorrange_end(constCustomPolygonRingRange&r){returnr.cend();}