From d7a88b6f7eeb0096b25dacc66ae54073f1d3cb80 Mon Sep 17 00:00:00 2001 From: Raoul Gough Date: Wed, 8 Oct 2003 15:39:04 +0000 Subject: [PATCH] Experimental hack for MSVC - use int for IndexStyle instead of an enum [SVN r20305] --- .../boost/python/suite/indexing/iterator_traits.hpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/include/boost/python/suite/indexing/iterator_traits.hpp b/include/boost/python/suite/indexing/iterator_traits.hpp index 1b2a493a..142da4f9 100755 --- a/include/boost/python/suite/indexing/iterator_traits.hpp +++ b/include/boost/python/suite/indexing/iterator_traits.hpp @@ -29,11 +29,23 @@ #include namespace boost { namespace python { namespace indexing { +#if !BOOST_MSVC enum IndexStyle { index_style_none // No random access (iteration only) , index_style_nonlinear // Random access by key (no slicing) , index_style_linear // Random access by integer index (allows slicing) }; +#else + // MSVC seems to have problems with static member variable constants + // of enumerated types, where it doesn't believe that an expression + // like (traits::index_style == index_style_linear) is a + // compile-time constant. However, the problem doesn't exist for + // int. + typedef int IndexStyle; + IndexStyle const index_style_none = 0; + IndexStyle const index_style_nonlinear = 1; + IndexStyle const index_style_linear = 2; +#endif ////////////////////////////////////////////////////////////////////////// // Indexing traits for containers based on iterator pairs