Re: [Boost-bugs] [Boost C++ Libraries] #10615: R-Tree: add constructor that converts any range<T> to the trees value type

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #10615: R-Tree: add constructor that converts any range<T> to the trees value type
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2014-10-07 10:46:08


#10615: R-Tree: add constructor that converts any range<T> to the trees value type
-------------------------------+---------------------------
  Reporter: anonymous | Owner: barendgehrels
      Type: Feature Requests | Status: closed
 Milestone: To Be Determined | Component: geometry
   Version: Boost 1.56.0 | Severity: Optimization
Resolution: wontfix | Keywords:
-------------------------------+---------------------------
Changes (by awulkiew):

 * status: new => closed
 * resolution: => wontfix

Comment:

 In my original example there is only transformed() used because initially
 I thought about calculating the index of a Point using iterator/pointer
 arithmetic, so something rather unsafe because if we at some later time
 changed vector to some other container the indexes would be invalid. So
 your solution using indexed() adaptor is more "correct".

 Actually I thought that transformed() requires standard unary predicates
 like STL algorithms to e.g. support lambda functions. But now when I think
 of it, it'd require C++11 or Boost.TypeOf. Anyway it's inconvenient that
 it doesn't. If it did then e.g. in C++14 we could write:

 {{{
 // This doesn't work for now
 rtree<indexed_point, /*Parameters*/>
     rt1(p | boost::adaptors::indexed()
           | boost::adaptors::transformed(
               [](auto v) { return std::make_pair(v.value(), v.index()); }
             ));
 }}}

 Regarding the docs/example, the docs and the code can always be improved.
 I expect that your use case is quite common so an example could be
 helpful.

 There is a hint in the docs, in the section ''Queries''->''Inserting query
 results into the other R-tree'':

 ''You may pass the result Range directly into the constructor or insert()
 member function.''
 {{{
 RTree rt4(rt1 | bgi::adaptors::queried(bgi::intersects(Box(/*...*/)))));
 }}}

 but maybe something similar should be placed in the section ''Creation and
 Modification'' since it may be not obvious how Boost.Range and the rtree
 could be used together.

 Thanks for suggestions!

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/10615#comment:4>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:17 UTC