xref: /trunk/main/stlport/systemstl/vector (revision 1828d080)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 #ifndef SYSTEM_STL_VECTOR
23 #define SYSTEM_STL_VECTOR
24 
25 #ifdef HAVE_STL_INCLUDE_PATH
26 	// TODO: use computed include file name
27 	#include_next <vector>
28 #elif defined(__cplusplus) && (__cplusplus >= 201103L)
29     #include_next <vector>
30 #elif defined(_MSC_VER)
31 	#include <../../VC/include/vector>
32 #else // fall back to boost/tr1
33 	#include <boost/tr1/tr1/vector>
34 #endif
35 
36 
37 #ifndef NO_STLPORT4_EMULATION
38 
39 namespace std
40 {
41     typedef vector<bool> bit_vector;
42 }
43 
44 // workaround some STL implementations having problems with their vector<bool>::count() specialization
45 inline int std_bitset_count( std::bit_vector::const_iterator it, std::bit_vector::const_iterator itEnd, bool bValue)
46 {
47 #if 0 && defined(_LIBCPP___BIT_REFERENCE) // TODO: reenable for libc++ >= r156543/r156546/etc.
48 	int nCount = std::count( it, itEnd, bValue);
49 #else
50 	int nCount = 0;
51 	for(; it != itEnd; ++it)
52 		if( *it == bValue)
53 			++nCount;
54 #endif
55 	return nCount;
56 }
57 
58 #endif // NO_STLPORT4_EMULATION
59 
60 #endif
61 
62