Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#11268 closed Bugs (fixed)

Regression in boost::geometry::intersection interface with multi_linestring and box -- does not compile on 1.57 VS 1.55

Reported by: anonymous Owned by: mkaravel
Milestone: Boost 1.59.0 Component: geometry
Version: Boost 1.57.0 Severity: Regression
Keywords: Cc: mkaravel

Description

Consider the following block of code, the boost::geometry::intersection between a multi-linestring and a box compiles and works on boost 1.55, but fails to compile with boost 1.57

#include <cstdlib>
#include <boost/geometry.hpp>
#include <boost/geometry/geometry.hpp>
#include <boost/geometry/geometries/point_xy.hpp>
#include <boost/geometry/geometries/linestring.hpp>
#include <boost/geometry/geometries/box.hpp>
#include <boost/geometry/multi/geometries/multi_linestring.hpp>
#include <boost/foreach.hpp>

int main()
{
    typedef boost::geometry::model::d2::point_xy<double> Point;
    typedef boost::geometry::model::box<Point> Box;
    typedef boost::geometry::model::linestring<Point> Linestring;
    typedef boost::geometry::model::multi_linestring<Linestring> MultiLinestring;

    Box box;
    Linestring ls;
    MultiLinestring mls;
    MultiLinestring out;

    // Case 1 - linestring with box
    // 1.55: OK
    // 1.57: OK
    boost::geometry::intersection(ls, box, out);

    // Case 2 - multi linestring with box
    // 1.55: OK
    // 1.57: ERROR - does not compile
            // clip_linestring.hpp:166:16: note: candidate function template not viable: requires 4 arguments, but 5 were provided
            // OutputIterator clip_range_with_box(Box const& b, Range const& range,
    boost::geometry::intersection(mls, box, out);
    
    return 0; 
}

Change History (6)

comment:1 Changed 3 years ago by anonymous

Regression occurs in 1.56 as well.

comment:2 Changed 3 years ago by mkaravel

Cc: mkaravel added
Milestone: To Be DeterminedBoost 1.58.0
Owner: changed from Barend Gehrels to mkaravel

I confirm that the bug indeed there. I will provide a patch shortly. Thanks for the report.

comment:3 Changed 3 years ago by mkaravel

Milestone: Boost 1.58.0Boost 1.59.0

comment:4 Changed 3 years ago by mkaravel

Status: newassigned

comment:5 Changed 3 years ago by mkaravel

Resolution: fixed
Status: assignedclosed

A patch has been submitted and merged into BG's develop branch.

comment:6 Changed 3 years ago by mkaravel

The bug fix may be found in PR 295

Note: See TracTickets for help on using tickets.