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