[Boost-bugs] [Boost C++ Libraries] #10345: Distance fails to compile for some coordinate types

Subject: [Boost-bugs] [Boost C++ Libraries] #10345: Distance fails to compile for some coordinate types
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2014-08-12 02:19:23


#10345: Distance fails to compile for some coordinate types
---------------------------------------+---------------------------
 Reporter: Branimir Betov <bbetov@…> | Owner: barendgehrels
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: geometry
  Version: Boost 1.56.0 | Severity: Problem
 Keywords: |
---------------------------------------+---------------------------
 Using Boost 1.56 and Visual C++ (2010, 2012, and 2013) the following code
 fails to compile and it used to work in 1.55.

 {{{
 #!cpp

 #include "stdafx.h"
 #include <string>
 #include <fstream>
 #include <streambuf>
 #include <boost/geometry.hpp>
 #include "boost/geometry/geometry.hpp"
 #include <boost/geometry/algorithms/distance.hpp>
 #include <boost/geometry/io/io.hpp>
 namespace bg = boost::geometry;
 using namespace std;

 int _tmain(int argc, _TCHAR* argv[])
 {
         typedef bg::model::point<double, 2,
 bg::cs::spherical_equatorial<double>> mypt;
         typedef bg::model::polygon<mypt> mypoly;
         mypoly poly;
         mypt pto(-122.13865, 38.69311);

         std::string str = "POLYGON((-122.07493 37.62602,-122.07585
 37.626158,-122.07638 37.6258760,-122.076338 37.6253233,-122.075417
 37.625003,-122.074693 37.62521,-122.0744 37.625605,-122.07449
 37.625765,-122.07449 37.6257,-122.07493 37.62602))";
         bg::read_wkt(str, poly);
         double aa = bg::distance(pto, poly); // in m

         return 0;
 }
 }}}

 The same failure happens for spherical and geographic coordinate systems,
 but works fine for cartesian coordinates.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/10345>
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:16 UTC