Opened 11 years ago

Closed 10 years ago

#6051 closed Bugs (fixed)

iT::value_type should use iterator_traits (needed for SunCC/stlport4 compatibility)

Reported by: Fedor Sergeev <Fedor.Sergeev@…> Owned by: Lucanus Simonson
Milestone: To Be Determined Component: polygon
Version: Boost 1.47.0 Severity: Problem
Keywords: Cc:

Description

polygon/gtl_boost_unit_test fails to compile with SunCC giving among anything else the following diagnostics:

] sunCC -library=stlport4 -I. libs/polygon/test/gtl_boost_unit_test.cpp -c
...
"./boost/polygon/polygon_traits.hpp", line 1039: Error: boost::polygon::iT is not a namespace or class name.
"./boost/polygon/polygon_traits.hpp", line 1067:     Where: While instantiating "boost::polygon::point_sequence_is_45<const boost::polygon::point_data<int>*>(const boost::polygon::point_data<int>*, const boost
"./boost/polygon/polygon_traits.hpp", line 1067:     Where: Instantiated from boost::polygon::is_45<boost::polygon::polygon_45_data<int>>(const boost::polygon::polygon_45_data<int>&).
"libs/polygon/test/gtl_boost_unit_test.cpp", line 1537:     Where: Instantiated from non-template code.
"./boost/polygon/polygon_traits.hpp", line 1039: Error: value_type is not defined.
"./boost/polygon/polygon_traits.hpp", line 1067:     Where: While instantiating "boost::polygon::point_sequence_is_45<const boost::polygon::point_data<int>*>(const boost::polygon::point_data<int>*, const boost
"./boost/polygon/polygon_traits.hpp", line 1067:     Where: Instantiated from boost::polygon::is_45<boost::polygon::polygon_45_data<int>>(const boost::polygon::polygon_45_data<int>&).
"libs/polygon/test/gtl_boost_unit_test.cpp", line 1537:     Where: Instantiated from non-template code.
"./boost/polygon/point_traits.hpp", line 16: Error: boost::polygon::T is not a namespace or class name.
"./boost/polygon/polygon_traits.hpp", line 1040:     Where: While specializing "boost::polygon::point_traits<int>".
"./boost/polygon/polygon_traits.hpp", line 1040:     Where: Instantiated from boost::polygon::point_sequence_is_45<const boost::polygon::point_data<int>*>(const boost::polygon::point_data<int>*, const boost::p
"./boost/polygon/polygon_traits.hpp", line 1067:     Where: Instantiated from boost::polygon::is_45<boost::polygon::polygon_45_data<int>>(const boost::polygon::polygon_45_data<int>&).
"libs/polygon/test/gtl_boost_unit_test.cpp", line 1537:     Where: Instantiated from non-template code.
...
]

That all happens because boost/polygon in a couple of places uses iT::value_type construct, which is a non-standard way to query value_type iterator trait. It works with g++, but it does not work with stlport (at least with stlport4 shipped with SunCC).

] git grep iT::value_type -- boost/polygon
boost/polygon/polygon_45_set_data.hpp:    typedef typename iT::value_type Point;
boost/polygon/polygon_traits.hpp:    typedef typename iT::value_type Point;
]

These should be converted to a standard way of querying iterator traits used throught all the boost (and polygon in particular) - std::iterator_traits<iT>::value_type

Attachments (1)

diffs (1.2 KB ) - added by Fedor Sergeev <Fedor.Sergeev@…> 11 years ago.
patch for iT::value_type

Download all attachments as: .zip

Change History (4)

by Fedor Sergeev <Fedor.Sergeev@…>, 11 years ago

Attachment: diffs added

patch for iT::value_type

comment:1 by anonymous, 11 years ago

Thanks, I was just having this exact problem. But googling boost polygon stlport turned up your solution - posted only 21 hours before! This kind of thing (fixes only a few hours or days before I hit a problem) seems like it happens too often to be coincidence.

If it helps anyone, I was having the problem on Windows 7 with ICL (intel compiler) v12.1, and STLPort 5.2.1. Perhaps boost should test with STLPort.

  • Daniel Faken

comment:2 by sydorchuk.andriy@…, 10 years ago

Will be fixed in Boost 1.52.

Andrii Sydorchuk

comment:3 by Lucanus Simonson, 10 years ago

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.