[Boost-bugs] [Boost C++ Libraries] #10077: From operands in boost/geometry/arithmetic.hpp require non-const operand

Subject: [Boost-bugs] [Boost C++ Libraries] #10077: From operands in boost/geometry/arithmetic.hpp require non-const operand
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2014-05-29 01:33:34


#10077: From operands in boost/geometry/arithmetic.hpp require non-const operand
-------------------------------------+---------------------------
 Reporter: smspillaz@… | Owner: barendgehrels
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: geometry
  Version: Boost Development Trunk | Severity: Problem
 Keywords: |
-------------------------------------+---------------------------
 The following code fails a concept check due to a typo in
 boost/geometry/arithmetic.hpp


 {{{
 #include <boost/geometry/geometries/register/point.hpp>
 #include <boost/geometry.hpp>

 struct ConstPoint
 {
     ConstPoint (float x, float y, float z) :
         x (x), y (y), z (z)
     {
     }

     const float x, y, z;
 };

 BOOST_GEOMETRY_REGISTER_POINT_3D_CONST(ConstPoint,
                                        float,
                                        boost::geometry::cs::cartesian,
                                        x, y, z);

 int main (void)
 {
     boost:geometry::model::point <float, 3,
 boost::geometry::cs::cartesian>model;
     ConstPoint cp (1, 2, 3);

     boost::geometry::assign (model, 1, 2, 3);
     boost::geometry::add_point (model, cp);

     return 0;
 }
 }}}

 This fails with a concept assertion:

 {{{
 wobblIn file included from
 /usr/local/include/boost/geometry/arithmetic/arithmetic.hpp:23:
 In file included from
 /usr/local/include/boost/geometry/geometries/concepts/point_concept.hpp:21:
 /usr/local/include/boost/geometry/core/access.hpp:173:43: error: no member
 named 'set' in 'boost::geometry::traits::access<ConstPoint, 0>'
         traits::access<Point, Dimension>::set(p, value);
         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
 /usr/local/include/boost/geometry/core/access.hpp:320:24: note: in
 instantiation of member function
 'boost::geometry::core_dispatch::access<boost::geometry::point_tag,
 ConstPoint, double, 0, boost::integral_constant<bool, false> >::set'
 requested here
     coord_access_type::set(geometry, value);
                        ^
 /usr/local/include/boost/geometry/geometries/concepts/point_concept.hpp:102:23:
 note: in instantiation of function template specialization
 'boost::geometry::set<0, ConstPoint >' requested here
             geometry::set<Dimension>(*p, geometry::get<Dimension>(*p));
                       ^
 /usr/local/include/boost/geometry/geometries/concepts/point_concept.hpp:119:49:
 note: in instantiation of member function
 'boost::geometry::concept::Point<ConstPoint
>::dimension_checker<ConstPoint, 0, 2>::apply' requested here
         dimension_checker<Geometry, 0, ccount>::apply();
                                                 ^
 /usr/local/include/boost/concept/usage.hpp:22:43: note: in instantiation
 of member function 'boost::geometry::concept::Point<ConstPoint >::~Point'
 requested here
     ~usage_requirements() { ((Model*)0)->~Model(); }
                                           ^
 /usr/local/include/boost/concept/detail/general.hpp:38:42: note: in
 instantiation of member function
 'boost::concepts::usage_requirements<boost::geometry::concept::Point<ConstPoint
> >::~usage_requirements' requested here
     static void failed() { ((Model*)0)->~Model(); }
                                          ^
 /usr/local/include/boost/geometry/geometries/concepts/point_concept.hpp:117:5:
 note: in instantiation of member function
 'boost::concepts::requirement<boost::concepts::failed
 ************boost::concepts::usage_requirements<boost::geometry::concept::Point<ConstPoint
> >::************>::failed' requested here
     BOOST_CONCEPT_USAGE(Point)
     ^
 /usr/local/include/boost/concept/usage.hpp:35:7: note: expanded from macro
 'BOOST_CONCEPT_USAGE'
       BOOST_CONCEPT_ASSERT((boost::concepts::usage_requirements<model>));
 \
       ^
 /usr/local/include/boost/concept/assert.hpp:44:5: note: expanded from
 macro 'BOOST_CONCEPT_ASSERT'
     BOOST_CONCEPT_ASSERT_FN(void(*)ModelInParens)
     ^
 /usr/local/include/boost/concept/detail/general.hpp:70:51: note: expanded
 from macro 'BOOST_CONCEPT_ASSERT_FN'
     &::boost::concepts::requirement_<ModelFnPtr>::failed> \
             ^
 In file included from
 /usr/local/include/boost/geometry/arithmetic/arithmetic.hpp:23:
 In file included from
 /usr/local/include/boost/geometry/geometries/concepts/point_concept.hpp:21:
 /usr/local/include/boost/geometry/core/access.hpp:173:43: error: no member
 named 'set' in 'boost::geometry::traits::access<ConstPoint, 1>'
         traits::access<Point, Dimension>::set(p, value);
         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
 /usr/local/include/boost/geometry/core/access.hpp:320:24: note: in
 instantiation of member function
 'boost::geometry::core_dispatch::access<boost::geometry::point_tag,
 ConstPoint, double, 1, boost::integral_constant<bool, false> >::set'
 requested here
     coord_access_type::set(geometry, value);
                        ^
 /usr/local/include/boost/geometry/geometries/concepts/point_concept.hpp:102:23:
 note: in instantiation of function template specialization
 'boost::geometry::set<1, ConstPoint >' requested here
             geometry::set<Dimension>(*p, geometry::get<Dimension>(*p));
                       ^
 /usr/local/include/boost/geometry/geometries/concepts/point_concept.hpp:103:64:
 note: in instantiation of member function
 'boost::geometry::concept::Point<ConstPoint
>::dimension_checker<ConstPoint, 1, 2>::apply' requested here
             dimension_checker<P, Dimension+1, DimensionCount>::apply();
                                                                ^
 /usr/local/include/boost/geometry/geometries/concepts/point_concept.hpp:119:49:
 note: in instantiation of member function
 'boost::geometry::concept::Point<ConstPoint
>::dimension_checker<ConstPoint, 0, 2>::apply' requested here
         dimension_checker<Geometry, 0, ccount>::apply();
                                                 ^
 /usr/local/include/boost/concept/usage.hpp:22:43: note: in instantiation
 of member function 'boost::geometry::concept::Point<ConstPoint >::~Point'
 requested here
     ~usage_requirements() { ((Model*)0)->~Model(); }
                                           ^
 /usr/local/include/boost/concept/detail/general.hpp:38:42: note: in
 instantiation of member function
 'boost::concepts::usage_requirements<boost::geometry::concept::Point<ConstPoint
> >::~usage_requirements' requested here
     static void failed() { ((Model*)0)->~Model(); }
                                          ^
 /usr/local/include/boost/geometry/geometries/concepts/point_concept.hpp:117:5:
 note: in instantiation of member function
 'boost::concepts::requirement<boost::concepts::failed
 ************boost::concepts::usage_requirements<boost::geometry::concept::Point<ConstPoint
> >::************>::failed' requested here
     BOOST_CONCEPT_USAGE(Point)
     ^
 /usr/local/include/boost/concept/usage.hpp:35:7: note: expanded from macro
 'BOOST_CONCEPT_USAGE'
       BOOST_CONCEPT_ASSERT((boost::concepts::usage_requirements<model>));
 \
       ^
 /usr/local/include/boost/concept/assert.hpp:44:5: note: expanded from
 macro 'BOOST_CONCEPT_ASSERT'
     BOOST_CONCEPT_ASSERT_FN(void(*)ModelInParens)
     ^
 /usr/local/include/boost/concept/detail/general.hpp:70:51: note: expanded
 from macro 'BOOST_CONCEPT_ASSERT_FN'
     &::boost::concepts::requirement_<ModelFnPtr>::failed> \
                                                   ^
 ...
 2 errors generated.
 }}}

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