xref: /aoo4110/main/stlport/systemstl/slist (revision b1cdbd2c)
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_SLIST
23#define SYSTEM_STL_SLIST
24
25#ifdef HAVE_STL_INCLUDE_PATH
26	// TODO: use computed include file name
27	#include_next <forward_list>
28#elif defined(__cplusplus) && (__cplusplus >= 201103L)
29	#include <forward_list>
30#elif defined(_MSC_VER)
31	#include <../../VC/include/list>
32	#define STLP4_SLIST_WITH_LIST
33	// MSVC's list would cause a lot of expression-result-unused warnings
34	// unless it is compiled in iterator-debugging mode. Silence this noise
35	#pragma warning(disable:4555)
36#else // fall back to boost/tr1 (forward_list or plain list)
37	#include <boost/config.hpp>
38	#ifndef BOOST_NO_0X_HDR_FORWARD_LIST
39		#include <boost/tr1/tr1/forward_list>
40	#else // fall back to the classic list
41		#include <boost/tr1/tr1/list>
42		#define STLP4_SLIST_WITH_LIST
43	#endif
44#endif
45
46
47#ifndef NO_STLPORT4_EMULATION
48
49#ifndef STLP4_SLIST_WITH_LIST
50    #define STLP4_SLIST_EMUBASE std::forward_list
51#else
52    #define STLP4_SLIST_EMUBASE std::list
53#endif
54
55namespace std
56{
57using STLP4_SLIST_EMUBASE;
58
59// lame emulation of the pre-C++11 slist using the std::forward_list (or std::list)
60template< typename T >
61class slist : public STLP4_SLIST_EMUBASE<T>
62{
63public:
64	typedef typename STLP4_SLIST_EMUBASE<T> _super;
65	typedef typename _super::iterator slist_mit;
66	typedef typename _super::const_iterator slist_cit;
67
68private: // prevent the use of methods not available in forward_list
69	// signatures are intentionally mismatched to catch invocations
70	size_t size() const;
71	void insert( void) const;
72};
73
74}
75
76#endif // NO_STLPORT4_EMULATION
77
78#endif
79
80