Skip to content

Commit 3bb3434

Browse files
author
Aleksey Gurtovoy
committed
fix MSVC 6.x ICE in 'vector_indexing_suite.cpp'
[SVN r25343]
1 parent 2121039 commit 3bb3434

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

include/boost/python/suite/indexing/detail/indexing_suite_detail.hpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
# include <boost/get_pointer.hpp>
1212
# include <boost/detail/binary_search.hpp>
1313
# include <boost/numeric/conversion/cast.hpp>
14+
# include <boost/detail/workaround.hpp>
15+
# include <boost/config.hpp>
1416
# include <vector>
1517
# include <map>
1618
#include <iostream>
@@ -590,7 +592,15 @@ namespace boost { namespace python { namespace detail {
590592
from = 0;
591593
if (from > max_index) // Clip upper bounds to max_index.
592594
from = max_index;
595+
596+
// agurt 21/sep/04: here and below -- MSVC 6.x ICEs in 'vector_indexing_suite.cpp'
597+
// unless we get skip 'boost::numeric_cast' layer and directly invoke the
598+
// underlaying convertor's method
599+
#if !BOOST_WORKAROUND(BOOST_MSVC, < 1300)
593600
from_ = boost::numeric_cast<Index>(from);
601+
#else
602+
from_ = boost::numeric::converter<Index,long>::convert(from);
603+
#endif
594604
}
595605

596606
if (Py_None == slice->stop) {
@@ -604,7 +614,12 @@ namespace boost { namespace python { namespace detail {
604614
to = 0;
605615
if (to > max_index)
606616
to = max_index;
617+
618+
#if !BOOST_WORKAROUND(BOOST_MSVC, < 1300)
607619
to_ = boost::numeric_cast<Index>(to);
620+
#else
621+
to_ = boost::numeric::converter<Index,long>::convert(to);
622+
#endif
608623
}
609624
}
610625

0 commit comments

Comments
 (0)