[geometry] how to using UDT
Hello, I try to catch some failures using an own user defined type (UDT), but it doesn't compile e.g. it's hardcoded to use std::sqrt: boost_1_55_0/boost/geometry/strategies/cartesian/distance_pythagoras.hpp:165:13: error: no matching function for call to 'sqrt(core::my_type<double>)' further, is there a way to adapt templated points? BOOST_GEOMETRY_REGISTER_POINT_2D(point_type, point_type::coordiante_type, bg::cs::cartesian, x, y) got errrors. Thanks, Olaf
Hi Olaf, Olaf Peter wrote On 13-6-2014 20:11:
Hello,
I try to catch some failures using an own user defined type (UDT), but it doesn't compile e.g. it's hardcoded to use std::sqrt:
boost_1_55_0/boost/geometry/strategies/cartesian/distance_pythagoras.hpp:165:13: error: no matching function for call to 'sqrt(core::my_type<double>)'
Indeed. We're currently fixing that.
further, is there a way to adapt templated points?
BOOST_GEOMETRY_REGISTER_POINT_2D(point_type, point_type::coordiante_type, bg::cs::cartesian, x, y)
Yes, it is possible but we don't have a macro for that. You can specialize your traits (5 traits) manually. For templates that is often convenient, to return the corresponding coordinate type. See c07_custom_ring_pointer_example.cpp from the examples folder. Regards, Barend
Am 13.06.2014 22:48, schrieb Barend Gehrels:
Hi Olaf,
Olaf Peter wrote On 13-6-2014 20:11:
Hello,
I try to catch some failures using an own user defined type (UDT), but it doesn't compile e.g. it's hardcoded to use std::sqrt:
boost_1_55_0/boost/geometry/strategies/cartesian/distance_pythagoras.hpp:165:13: error: no matching function for call to 'sqrt(core::my_type<double>)'
Indeed. We're currently fixing that. Super, when will it be finished? What are the other math function calls I didn't covered yet?
further, is there a way to adapt templated points?
BOOST_GEOMETRY_REGISTER_POINT_2D(point_type, point_type::coordiante_type, bg::cs::cartesian, x, y)
Yes, it is possible but we don't have a macro for that. You can specialize your traits (5 traits) manually. For templates that is often convenient, to return the corresponding coordinate type.
See c07_custom_ring_pointer_example.cpp from the examples folder. works as expected :)
Thanks, Olaf
participants (2)
-
Barend Gehrels
-
Olaf Peter