Boost logo

Boost :

Subject: Re: [boost] Final report of GSOC project 'Spatial Indexes'
From: Federico J. Fernández (federico.fernandez_at_[hidden])
Date: 2008-10-01 08:46:49


>
> When you do rectangle queries, I think you should use an output
> iterator rather than returning a deque like you do in this line from
> your tutorial:
>
> geometry::box<geometry::point_xy<double> > query_box(
> geometry::point_xy<double>(0.0, 0.0),
> geometry::point_xy<double>(5.0, 5.0));
> std::deque< std::vector<std::string>::iterator > d = q.find(query_box);
>
> One, that is a rather heavy return type. Two, you're exposing an
> implementation detail. I find the following much nicer:
>
> geometry::box<geometry::point_xy<double> > query_box(
> geometry::point_xy<double>(0.0, 0.0),
> geometry::point_xy<double>(5.0, 5.0));
> std::vector< std::vector<std::string>::iterator > d;
> q.find(query_box, std::back_inserter(d));
>
> I haven't looked at the code, only the docs, so please excuse me if
> this functionality already exists.
>

I agree 100%. I'm adding this to my improvements list.

Thanks for you suggestion.

--
federico

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk