Opened 6 years ago

Last modified 6 years ago

#12305 new Bugs

Requirements for traits::interior_{const,mutable}_type

Reported by: john.firebaugh@… Owned by: Barend Gehrels
Milestone: To Be Determined Component: geometry
Version: Boost 1.61.0 Severity: Problem
Keywords: Cc: john.firebaugh@…

Description

The documentation of Polygon Concept states:

there must be a specialization of traits::interior_type defining the type of the collection of its interior rings as type; this collection itself must fulfill a Boost.Range Random Access Range Concept

(Emphasis mine; the mention of traits::interior_type should actually be traits::interior_const_type and traits::interior_mutable_type -- ticket #12304 -- but the issue I'm reporting here has to do with the latter bolded part of the statement.)

It appears that boost::geometry::intersection makes requirements on the interior type that are not a part of the Boost.Range Random Access Range Concept. Specifically, boost/geometry/algorithms/detail/overlay/convert_ring.hpp calls `interior_rings(destination).resize(...)`, and resize is not part of the Random Access Range Concept.

A test case is attached; it fails to compile with the following error:

<path>/boost/1.61.0/include/boost/geometry/algorithms/detail/overlay/convert_ring.hpp:90:45: error: no member named
      'resize' in 'boost::iterator_range<std::__1::__wrap_iter<std::__1::vector<point, std::__1::allocator<point> > *> >'
                interior_rings(destination).resize(
                ~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^

Is this an error in convert_ring.hpp, or are there additional requirements on the interior type which are not documented?

Attachments (1)

boost.cpp (2.0 KB ) - added by anonymous 6 years ago.

Download all attachments as: .zip

Change History (6)

by anonymous, 6 years ago

Attachment: boost.cpp added

comment:1 by anonymous, 6 years ago

Any Boost developers have insight on this problem?

comment:1 by anonymous, 6 years ago

Any Boost developers have insight on this problem?

comment:2 by viboes, 6 years ago

Component: Nonepolygon
Owner: set to Lucanus Simonson

Assign to the good library next time.

comment:3 by anonymous, 6 years ago

This should be assigned to "geometry" not polygon.

comment:4 by anonymous, 6 years ago

Component: polygongeometry
Owner: changed from Lucanus Simonson to Barend Gehrels
Note: See TracTickets for help on using tickets.