numeric_cast/MPL/vc6 conflict

The introduction of mpl::numeric_cast has caused a regression in libs\python\test\vector_indexing_suite.cpp for vc6. How shall we resolve this problem? -- Dave Abrahams Boost Consulting http://www.boost-consulting.com

David Abrahams writes:
The introduction of mpl::numeric_cast has caused a regression in libs\python\test\vector_indexing_suite.cpp for vc6. How shall we resolve this problem?
Resolved in the CVS: +#include <boost/mpl/aux_/config/msvc.hpp> +#include <boost/mpl/aux_/config/workaround.hpp> + +// agurt 21/sep/04: portability macro for the sake of MSVC 6.x-7.0; +// resolves conflicts with 'boost::numeric_cast' function template. +// use it in your own code _only_ if you care about compatibility with +// these outdated compilers! +#if BOOST_WORKAROUND(BOOST_MSVC, <= 1300) +# define BOOST_MPL_AUX_NUMERIC_CAST numeric_cast_ +#else +# define BOOST_MPL_AUX_NUMERIC_CAST numeric_cast +#endif ... only to find that it was masking an ICE. I'll have to look at it later today. -- Aleksey Gurtovoy MetaCommunications Engineering

"Aleksey Gurtovoy" <agurtovoy@meta-comm.com> writes:
David Abrahams writes:
The introduction of mpl::numeric_cast has caused a regression in libs\python\test\vector_indexing_suite.cpp for vc6. How shall we resolve this problem?
Resolved in the CVS:
+#include <boost/mpl/aux_/config/msvc.hpp> +#include <boost/mpl/aux_/config/workaround.hpp> + +// agurt 21/sep/04: portability macro for the sake of MSVC 6.x-7.0; +// resolves conflicts with 'boost::numeric_cast' function template. +// use it in your own code _only_ if you care about compatibility with +// these outdated compilers! +#if BOOST_WORKAROUND(BOOST_MSVC, <= 1300) +# define BOOST_MPL_AUX_NUMERIC_CAST numeric_cast_ +#else +# define BOOST_MPL_AUX_NUMERIC_CAST numeric_cast +#endif
... only to find that it was masking an ICE. I'll have to look at it later today.
Thanks for pursuing this! -- Dave Abrahams Boost Consulting http://www.boost-consulting.com

Aleksey Gurtovoy writes:
David Abrahams writes:
The introduction of mpl::numeric_cast has caused a regression in libs\python\test\vector_indexing_suite.cpp for vc6. How shall we resolve this problem?
Resolved in the CVS:
[...]
... only to find that it was masking an ICE. I'll have to look at it later today.
Tracked down and fixed now: =================================================================== RCS file: /cvsroot/boost/boost/boost/python/suite/indexing/detail/indexing_suite_detail.hpp,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- indexing_suite_detail.hpp 20 Sep 2004 13:39:37 -0000 1.12 +++ indexing_suite_detail.hpp 22 Sep 2004 16:54:04 -0000 1.13 @@ -11,6 +11,8 @@ # include <boost/get_pointer.hpp> # include <boost/detail/binary_search.hpp> # include <boost/numeric/conversion/cast.hpp> +# include <boost/detail/workaround.hpp> +# include <boost/config.hpp> # include <vector> # include <map> #include <iostream> @@ -590,7 +592,15 @@ from = 0; if (from > max_index) // Clip upper bounds to max_index. from = max_index; + +// agurt 21/sep/04: here and below -- MSVC 6.x ICEs in 'vector_indexing_suite.cpp' +// unless we get skip 'boost::numeric_cast' layer and directly invoke the +// underlaying convertor's method +#if !BOOST_WORKAROUND(BOOST_MSVC, < 1300) from_ = boost::numeric_cast<Index>(from); +#else + from_ = boost::numeric::converter<Index,long>::convert(from); +#endif } if (Py_None == slice->stop) { @@ -604,7 +614,12 @@ to = 0; if (to > max_index) to = max_index; + +#if !BOOST_WORKAROUND(BOOST_MSVC, < 1300) to_ = boost::numeric_cast<Index>(to); +#else + to_ = boost::numeric::converter<Index,long>::convert(to); +#endif } } Our regression machine is in the middle of the cycle, though, so the results will get into the reports only in ~20 hours. -- Aleksey Gurtovoy MetaCommunications Engineering

"Aleksey Gurtovoy" <agurtovoy@meta-comm.com> writes:
Tracked down and fixed now:
Thanks a million. You are really doing an incredible amount of work for the release; the community thanks you. -- Dave Abrahams Boost Consulting http://www.boost-consulting.com
participants (2)
-
Aleksey Gurtovoy
-
David Abrahams