/************************************************************** * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * *************************************************************/ #ifndef SYSTEM_STL_SLIST #define SYSTEM_STL_SLIST #ifdef HAVE_STL_INCLUDE_PATH // TODO: use computed include file name #include_next #elif defined(_MSC_VER) #include <../../VC/include/list> #define STLP4_SLIST_WITH_LIST // MSVC's list would cause a lot of expression-result-unused warnings // unless it is compiled in iterator-debugging mode. Silence this noise #pragma warning(disable:4555) #else // fall back to boost/tr1 (forward_list or plain list) #include #ifndef BOOST_NO_0X_HDR_FORWARD_LIST #include #else // fall back to the classic list #include #define STLP4_SLIST_WITH_LIST #endif #endif #ifndef NO_STLPORT4_EMULATION #ifndef STLP4_SLIST_WITH_LIST #define STLP4_SLIST_EMUBASE std::forward_list #else #define STLP4_SLIST_EMUBASE std::list #endif namespace std { using STLP4_SLIST_EMUBASE; // lame emulation of the pre-C++11 slist using the std::forward_list (or std::list) template< typename T, class A=allocator > class slist : public STLP4_SLIST_EMUBASE { public: typedef typename STLP4_SLIST_EMUBASE _super; typedef typename _super::iterator slist_mit; typedef typename _super::const_iterator slist_cit; #ifndef STLP4_SLIST_WITH_LIST slist_mit insert( slist_cit aI, const T& rT) { return _super::insert_after( aI, rT); } #else private: size_t size() const; // prevent use of slist::size() as forward_list doesn't have a size() method #endif }; } #endif // NO_STLPORT4_EMULATION #endif