slist (e76eebc6) slist (dee715a7)
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

--- 8 unchanged lines hidden (view full) ---

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
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

--- 8 unchanged lines hidden (view full) ---

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 GCC
25#ifdef HAVE_STL_INCLUDE_PATH
26 // TODO: use computed include file name
27 #include_next <forward_list>
28#elif defined(_MSC_VER)
29 #include <../../VC/include/list>
30 #define STLP4_SLIST_WITH_LIST
31 // MSVC's list would cause a lot of expression-result-unused warnings
32 // unless it is compiled in iterator-debugging mode. Silence this noise
33 #pragma warning(disable:4555)
34#else // fall back to boost/tr1 (forward_list or plain list)
35 #include <boost/config.hpp>
36 #ifndef BOOST_NO_0X_HDR_FORWARD_LIST
37 #include <boost/tr1/tr1/forward_list>
38 #else // fall back to the classic list
39 #include <boost/tr1/tr1/list>
40 #define STLP4_SLIST_WITH_LIST
41 #endif
42#endif
26
43
27#include <ext/slist>
28
44
45#ifndef NO_STLPORT4_EMULATION
46
47#ifndef STLP4_SLIST_WITH_LIST
48 #define STLP4_SLIST_EMUBASE std::forward_list
49#else
50 #define STLP4_SLIST_EMUBASE std::list
51#endif
52
29namespace std
30{
53namespace std
54{
31 using __gnu_cxx::slist;
32}
33#else
34#error UNSUPPORTED COMPILER
55using STLP4_SLIST_EMUBASE;
56
57// lame emulation of the pre-C++11 slist using the std::forward_list (or std::list)
58template< typename T, class A=allocator<T> >
59class slist : public STLP4_SLIST_EMUBASE<T,A>
60{
61public:
62 typedef typename STLP4_SLIST_EMUBASE<T,A> _super;
63 typedef typename _super::iterator slist_mit;
64 typedef typename _super::const_iterator slist_cit;
65#ifndef STLP4_SLIST_WITH_LIST
66 slist_mit insert( slist_cit aI, const T& rT) { return _super::insert_after( aI, rT); }
35#endif
67#endif
68};
36
69
70}
37
71
72#endif // NO_STLPORT4_EMULATION
73
38#endif
74#endif
39/* vi:set tabstop=4 shiftwidth=4 expandtab: */
75