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