From 1addeee962da39c7db66a4fd74c94e6e1610eeab Mon Sep 17 00:00:00 2001 From: Raoul Gough Date: Tue, 28 Oct 2003 15:23:18 +0000 Subject: [PATCH] Move definition of index_style_t from iterator_traits.hpp into suite_utils.hpp [SVN r20525] --- .../python/suite/indexing/suite_utils.hpp | 20 +++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/include/boost/python/suite/indexing/suite_utils.hpp b/include/boost/python/suite/indexing/suite_utils.hpp index 2cb51302..47303678 100755 --- a/include/boost/python/suite/indexing/suite_utils.hpp +++ b/include/boost/python/suite/indexing/suite_utils.hpp @@ -1,5 +1,3 @@ -// -*- mode:c++ -*- -// // Header file suite_utils.hpp // // Shared utilities for the indexing suite. @@ -23,6 +21,24 @@ #include namespace boost { namespace python { namespace indexing { +#if !BOOST_MSVC + enum index_style_t { + 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 index_style_t; + index_style_t const index_style_none = 0; + index_style_t const index_style_nonlinear = 1; + index_style_t const index_style_linear = 2; +#endif + template class is_mutable_ref {