Opened 7 years ago

Closed 7 years ago

#11522 closed Bugs (fixed)

Boost.Geometry - not enough namespace prefixing in boost/geometry/detail/buffer/buffered_ring.hpp

Reported by: steve.hickman@… Owned by: Barend Gehrels
Milestone: Boost 1.60.0 Component: geometry
Version: Boost 1.58.0 Severity: Showstopper
Keywords: Cc:

Description

Compiling v 1.58 with Visual Studio 2012, I get the following errors:

1>d:\boost\boost_1_58_0\boost\geometry\algorithms\detail\buffer\buffered_ring.hpp(98): error C3083: 'buffer': the symbol to the left of a '::' must be a type 1>d:\boost\boost_1_58_0\boost\geometry\algorithms\detail\buffer\buffered_ring.hpp(98): error C2039: 'buffered_ring' : is not a member of 'boost::geometry::traits::detail' 1>d:\boost\boost_1_58_0\boost\geometry\algorithms\detail\buffer\buffered_ring.hpp(98): error C2065: 'buffered_ring' : undeclared identifier 1>d:\boost\boost_1_58_0\boost\geometry\algorithms\detail\buffer\buffered_ring.hpp(98): error C2974: 'boost::geometry::traits::tag' : invalid template argument for 'Geometry', type expected 1> d:\boost\boost_1_58_0\boost\geometry\core\tag.hpp(42) : see declaration of 'boost::geometry::traits::tag' 1>d:\boost\boost_1_58_0\boost\geometry\algorithms\detail\buffer\buffered_ring.hpp(98): error C2143: syntax error : missing ';' before '>' 1>d:\boost\boost_1_58_0\boost\geometry\algorithms\detail\buffer\buffered_ring.hpp(98): error C2976: 'boost::geometry::traits::tag' : too few template arguments 1> d:\boost\boost_1_58_0\boost\geometry\core\tag.hpp(42) : see declaration of 'boost::geometry::traits::tag' 1>d:\boost\boost_1_58_0\boost\geometry\algorithms\detail\buffer\buffered_ring.hpp(98): error C2059: syntax error : '>' 1>d:\boost\boost_1_58_0\boost\geometry\algorithms\detail\buffer\buffered_ring.hpp(99): error C2143: syntax error : missing ';' before '{' 1>d:\boost\boost_1_58_0\boost\geometry\algorithms\detail\buffer\buffered_ring.hpp(99): error C2447: '{' : missing function header (old-style formal list?) 1>d:\boost\boost_1_58_0\boost\geometry\algorithms\detail\buffer\buffered_ring.hpp(105): error C3083: 'buffer': the symbol to the left of a '::' must be a type 1>d:\boost\boost_1_58_0\boost\geometry\algorithms\detail\buffer\buffered_ring.hpp(105): error C2039: 'buffered_ring' : is not a member of 'boost::geometry::traits::detail' 1>d:\boost\boost_1_58_0\boost\geometry\algorithms\detail\buffer\buffered_ring.hpp(105): error C2065: 'buffered_ring' : undeclared identifier 1>d:\boost\boost_1_58_0\boost\geometry\algorithms\detail\buffer\buffered_ring.hpp(105): error C2974: 'boost::geometry::traits::point_order' : invalid template argument for 'Ring', type expected 1> d:\boost\boost_1_58_0\boost\geometry\core\point_order.hpp(70) : see declaration of 'boost::geometry::traits::point_order' 1>d:\boost\boost_1_58_0\boost\geometry\algorithms\detail\buffer\buffered_ring.hpp(105): error C2143: syntax error : missing ';' before '>' 1>d:\boost\boost_1_58_0\boost\geometry\algorithms\detail\buffer\buffered_ring.hpp(105): error C2059: syntax error : '>' 1>d:\boost\boost_1_58_0\boost\geometry\algorithms\detail\buffer\buffered_ring.hpp(106): error C2143: syntax error : missing ';' before '{' 1>d:\boost\boost_1_58_0\boost\geometry\algorithms\detail\buffer\buffered_ring.hpp(106): error C2447: '{' : missing function header (old-style formal list?) 1>d:\boost\boost_1_58_0\boost\geometry\algorithms\detail\buffer\buffered_ring.hpp(112): error C3083: 'buffer': the symbol to the left of a '::' must be a type 1>d:\boost\boost_1_58_0\boost\geometry\algorithms\detail\buffer\buffered_ring.hpp(112): error C2039: 'buffered_ring' : is not a member of 'boost::geometry::traits::detail' 1>d:\boost\boost_1_58_0\boost\geometry\algorithms\detail\buffer\buffered_ring.hpp(112): error C2065: 'buffered_ring' : undeclared identifier 1>d:\boost\boost_1_58_0\boost\geometry\algorithms\detail\buffer\buffered_ring.hpp(112): error C2974: 'boost::geometry::traits::closure' : invalid template argument for 'G', type expected 1> d:\boost\boost_1_58_0\boost\geometry\core\closure.hpp(76) : see declaration of 'boost::geometry::traits::closure' 1>d:\boost\boost_1_58_0\boost\geometry\algorithms\detail\buffer\buffered_ring.hpp(112): error C2143: syntax error : missing ';' before '>' 1>d:\boost\boost_1_58_0\boost\geometry\algorithms\detail\buffer\buffered_ring.hpp(112): error C2059: syntax error : '>' 1>d:\boost\boost_1_58_0\boost\geometry\algorithms\detail\buffer\buffered_ring.hpp(113): error C2143: syntax error : missing ';' before '{' 1>d:\boost\boost_1_58_0\boost\geometry\algorithms\detail\buffer\buffered_ring.hpp(113): error C2447: '{' : missing function header (old-style formal list?) 1>d:\boost\boost_1_58_0\boost\geometry\algorithms\detail\buffer\buffered_ring.hpp(119): error C3083: 'buffer': the symbol to the left of a '::' must be a type 1>d:\boost\boost_1_58_0\boost\geometry\algorithms\detail\buffer\buffered_ring.hpp(119): error C2039: 'buffered_ring_collection' : is not a member of 'boost::geometry::traits::detail' 1>d:\boost\boost_1_58_0\boost\geometry\algorithms\detail\buffer\buffered_ring.hpp(119): error C2065: 'buffered_ring_collection' : undeclared identifier 1>d:\boost\boost_1_58_0\boost\geometry\algorithms\detail\buffer\buffered_ring.hpp(119): error C2974: 'boost::geometry::traits::point_type' : invalid template argument for 'Geometry', type expected 1> d:\boost\boost_1_58_0\boost\geometry\core\point_type.hpp(44) : see declaration of 'boost::geometry::traits::point_type' 1>d:\boost\boost_1_58_0\boost\geometry\algorithms\detail\buffer\buffered_ring.hpp(119): error C2143: syntax error : missing ';' before '>' 1>d:\boost\boost_1_58_0\boost\geometry\algorithms\detail\buffer\buffered_ring.hpp(119): error C2059: syntax error : '>' 1>d:\boost\boost_1_58_0\boost\geometry\algorithms\detail\buffer\buffered_ring.hpp(120): error C2143: syntax error : missing ';' before '{' 1>d:\boost\boost_1_58_0\boost\geometry\algorithms\detail\buffer\buffered_ring.hpp(120): error C2447: '{' : missing function header (old-style formal list?) 1>d:\boost\boost_1_58_0\boost\geometry\algorithms\detail\buffer\buffered_ring.hpp(128): error C2976: 'boost::geometry::traits::tag' : too few template arguments 1> d:\boost\boost_1_58_0\boost\geometry\core\tag.hpp(42) : see declaration of 'boost::geometry::traits::tag' 1>d:\boost\boost_1_58_0\boost\geometry\geometries\linestring.hpp(119): error C3855: 'boost::geometry::traits::tag': template parameter 'Enable' is incompatible with the declaration 1>d:\boost\boost_1_58_0\boost\geometry\geometries\linestring.hpp(119): error C2977: 'boost::geometry::traits::tag' : too many template arguments 1> d:\boost\boost_1_58_0\boost\geometry\core\tag.hpp(42) : see declaration of 'boost::geometry::traits::tag' 1>d:\boost\boost_1_58_0\boost\geometry\geometries\polygon.hpp(174): error C3855: 'boost::geometry::traits::tag': template parameter 'Enable' is incompatible with the declaration 1>d:\boost\boost_1_58_0\boost\geometry\geometries\polygon.hpp(174): error C2977: 'boost::geometry::traits::tag' : too many template arguments 1> d:\boost\boost_1_58_0\boost\geometry\core\tag.hpp(42) : see declaration of 'boost::geometry::traits::tag' 1>d:\boost\boost_1_58_0\boost\geometry\geometries\multi_point.hpp(118): error C3855: 'boost::geometry::traits::tag': template parameter 'Enable' is incompatible with the declaration 1>d:\boost\boost_1_58_0\boost\geometry\geometries\multi_point.hpp(118): error C2977: 'boost::geometry::traits::tag' : too many template arguments 1> d:\boost\boost_1_58_0\boost\geometry\core\tag.hpp(42) : see declaration of 'boost::geometry::traits::tag' 1>d:\boost\boost_1_58_0\boost\geometry\geometries\multi_linestring.hpp(112): error C3855: 'boost::geometry::traits::tag': template parameter 'Enable' is incompatible with the declaration 1>d:\boost\boost_1_58_0\boost\geometry\geometries\multi_linestring.hpp(112): error C2977: 'boost::geometry::traits::tag' : too many template arguments 1> d:\boost\boost_1_58_0\boost\geometry\core\tag.hpp(42) : see declaration of 'boost::geometry::traits::tag' 1>d:\boost\boost_1_58_0\boost\geometry\geometries\point_xy.hpp(88): error C2953: 'boost::geometry::traits::tag' : class template has already been defined 1> d:\boost\boost_1_58_0\boost\geometry\core\tag.hpp(42) : see declaration of 'boost::geometry::traits::tag'


The problem is that the namespace hierarchy is such that lines with the errors are in a different namespace hierarchy (boost::geometry::detail) than the structs they are referring to (boost::geometry). Because these references aren't fully prefixed, the compiler can't find them (there is no "using namespace boost::geometry" preceding their inclusion. Libraries should not assume that users will specify such a thing.) This can be fixed by editing lines 97-128 to be the following:


template <typename Ring> struct tag<boost::geometry::detail::buffer::buffered_ring<Ring> > {

typedef ring_tag type;

};

template <typename Ring> struct point_order<boost::geometry::detail::buffer::buffered_ring<Ring> > {

static const order_selector value = geometry::point_order<Ring>::value;

};

template <typename Ring> struct closure<boost::geometry::detail::buffer::buffered_ring<Ring> > {

static const closure_selector value = geometry::closure<Ring>::value;

};

template <typename Ring> struct point_type<boost::geometry::detail::buffer::buffered_ring_collection<Ring> > {

typedef typename geometry::point_type<Ring>::type type;

};

template <typename Ring> struct tag<boost::geometry::detail::buffer::buffered_ring_collection<Ring> > {

typedef boost::geometry::detail::buffer::buffered_ring_collection_tag type;

};

Change History (1)

comment:1 by Barend Gehrels, 7 years ago

Milestone: To Be DeterminedBoost 1.60.0
Resolution: fixed
Status: newclosed

Thanks for the message. So somewhere there is a traits::detail namespace in the other code which triggers this error. I prefixed geometry:: as we usually do.

Note: See TracTickets for help on using tickets.