[Polygon] Template error in CodeWarrior when attempting union on polygon_set_data

I hesitate to mark this as [Polygon] because the error message is in a different part of Boost. However, I have little idea what the actual cause of the problem is or what any of the relevant stuff even means, so I figure [Polygon] is as good as anything at the moment... As before, this is a custom version of CodeWarrior an embedded ARM system, so I have no idea how well it corresponds with other versions of CodeWarrior. Here is a trivial program that illustrates the problem, using the BOOST_VERY_LITTLE_SFINAE patch from the last discussion here: #include <iostream> #define BOOST_VERY_LITTLE_SFINAE #include <boost/polygon/polygon.hpp> using namespace boost::polygon; using namespace boost::polygon::operators; int main() { polygon_set_data<int> ps; ps += rectangle_data<int>(0, 0, 1, 1); return 0; } This results in the following error message : Error : illegal use of template argument dependent type 'T::type' The error occurs in this part of boost/mpl/aux_/preprocessed/plain/and.hpp: template< typename T1, typename T2, typename T3, typename T4 > struct and_impl< true,T1,T2,T3,T4 > : and_impl< BOOST_MPL_AUX_NESTED_TYPE_WKND(T1)::value , T2, T3, T4 , true_ > { }; Any ideas about what's wrong or how to fix it? - Kef

Kef Schecter wrote:
I hesitate to mark this as [Polygon] because the error message is in a different part of Boost. However, I have little idea what the actual cause of the problem is or what any of the relevant stuff even means, so I figure [Polygon] is as good as anything at the moment...
As before, this is a custom version of CodeWarrior an embedded ARM system, so I have no idea how well it corresponds with other versions of CodeWarrior.
Please try polygon in standalone mode and define the BOOST_POLYGON_NO_DEPS macro. In order to use mpl and and or for SFINAE I had to pull in quite a lot of the mpl. My own implementation of these is enabled by the macro and if you see a compiler error with them I'll quickly be able to understand the problem. If you don't see a compiler error with the macro then I can come up with a new macro to exclude mpl dependency but still use enable_if and config.hpp.
Here is a trivial program that illustrates the problem, using the BOOST_VERY_LITTLE_SFINAE patch from the last discussion here:
#include <iostream> #define BOOST_VERY_LITTLE_SFINAE #define BOOST_POLYGON_NO_DEPS #include <boost/polygon/polygon.hpp>
using namespace boost::polygon; using namespace boost::polygon::operators;
int main() { polygon_set_data<int> ps; ps += rectangle_data<int>(0, 0, 1, 1); return 0; }
This results in the following error message :
Error : illegal use of template argument dependent type 'T::type'
The error occurs in this part of boost/mpl/aux_/preprocessed/plain/and.hpp:
template< typename T1, typename T2, typename T3, typename T4 > struct and_impl< true,T1,T2,T3,T4 > : and_impl< BOOST_MPL_AUX_NESTED_TYPE_WKND(T1)::value , T2, T3, T4 , true_ > { };
Any ideas about what's wrong or how to fix it?
- Kef
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

Please try polygon in standalone mode I have to admit I'm not sure what you mean by "standalone mode", unless you mean defining BOOST_POLYGON_NO_DEPS means "standalone mode". So I did that and I get the same error, but at a different point now, in boost/polygon/isotropy.hpp:
struct gtl_and : gtl_and_c<T::value, T2::value> {}; I forgot to mention last time that I also got a second error (with the same message) here, in boost/utility/enable_if.hpp: template <class Cond, class T = void> struct enable_if : public enable_if_c<Cond::value, T> {}; This error still happens with the BOOST_POLYGON_NO_DEPS macro, with the same code in boost/polygon/isotropy.hpp. - Kef

Kef Schecter wrote:
Please try polygon in standalone mode I have to admit I'm not sure what you mean by "standalone mode", unless you mean defining BOOST_POLYGON_NO_DEPS means "standalone mode". So I did that and I get the same error, but at a different point now, in boost/polygon/isotropy.hpp:
struct gtl_and : gtl_and_c<T::value, T2::value> {};
I forgot to mention last time that I also got a second error (with the same message) here, in boost/utility/enable_if.hpp:
template <class Cond, class T = void> struct enable_if : public enable_if_c<Cond::value, T> {};
This error still happens with the BOOST_POLYGON_NO_DEPS macro, with the same code in boost/polygon/isotropy.hpp.
Yep, SFINAE just isn't going to work for CodeWarrior. These things with _c<T::value are because MSVC does semantic checks differently for templates with literal parameters than with types as parameters and SFINAE works better with the checks it applies to literal parameters because it seems to apply them earlier. Thanks for giving my library a try. Luke
participants (2)
-
Kef Schecter
-
Simonson, Lucanus J