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:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user