2
0
mirror of https://github.com/boostorg/python.git synced 2026-01-24 18:12:43 +00:00

Use bitwise combination of numeric method IDs to decide what to support

[SVN r22197]
This commit is contained in:
Raoul Gough
2004-02-08 19:04:39 +00:00
parent d79c063b97
commit 2c8f1fb5d3
3 changed files with 17 additions and 13 deletions

View File

@@ -1,11 +1,14 @@
// Module test_vector_disable.cpp
//
// Copyright (c) 2003 Raoul M. Gough
//
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy
// at http://www.boost.org/LICENSE_1_0.txt)
//
// Module test_vector_disable.cpp
//
// Expose a vector with minimal supported methods. Should produce a
// much smaller object file that otherwise.
//
// History
// =======
// 2003/11/19 rmg File creation
@@ -26,15 +29,20 @@ BOOST_PYTHON_MODULE(test_vector_disable_ext)
typedef std::vector<int> Container1;
// Generate a vector suite with all optional support disabled
// Binary mask for the four methods we want to support
unsigned int const mask
= indexing::method_getitem
| indexing::method_setitem
| indexing::method_delitem
| indexing::method_append;
#if !defined (BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
// Normal case (automatic algorithm and traits selection)
typedef indexing::container_suite<Container1, indexing::minimum_support>
typedef indexing::container_suite<Container1, mask>
Suite1;
#else
// For broken compilers - explicit selection of algorithms/traits
typedef indexing::vector_suite<Container1, indexing::minimum_support>
typedef indexing::vector_suite<Container1, mask>
Suite1;
#endif