Boost logo

Boost Users :

Subject: [Boost-users] [geometry] weird define in adapted fusion sequence
From: alfC (alfredo.correa_at_[hidden])
Date: 2011-08-15 06:59:35


Hi,

 Trying (again) to use Boost.Geometry with coordinates with
Boost.Units (BTW, what is the status of the compatibility between
geometry and units?) I found the following macro definition in boost/
geometry/geometries/adapted/boost_fusion.hpp

// Convenience registration macro to bind a Fusion sequence to a CS
#define BOOST_GEOMETRY_REGISTER_BOOST_FUSION_CS(CoordinateSystem) \
    namespace boost { namespace geometry { namespace traits { \
    template <typename Sequence> \
    struct coordinate_system \
               < \
                   Sequence, \
                   typename boost::enable_if \
                       < \
 
fusion_adapt_detail::is_fusion_sequence<Sequence> \
>::type \
> \
    { typedef cs::cartesian type; }; \
    }}}

Unless I am missing something, the definition of the macro does not
depend on the parameter "CoordinateSystem" !. To make the situation
even more confusing the manual's example (http://www.boost.org/doc/
libs/1_47_0/libs/geometry/doc/html/geometry/reference/adapted/
boost_fusion.html) uses the struct as the parameter and not the
coordinate system !

Unless I am wrong the last lines of the definition of
BOOST_GEOMETRY_REGISTER_BOOST_FUSION_CS should be:

    { typedef CoordinateSystem type; }; \
    }}}

and the manual should be updated accordingly. E.g. the example should
read

BOOST_FUSION_ADAPT_STRUCT(sample_point, (double, x) (double, y)
(double, z))
BOOST_GEOMETRY_REGISTER_BOOST_FUSION_CS(cs::cartesian)

Am I missing something?

Thanks,
Alfredo


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net