[857] | 1 | // Boost string_algo library list_traits.hpp header file ---------------------------//
|
---|
| 2 |
|
---|
| 3 | // Copyright Pavol Droba 2002-2003. Use, modification and
|
---|
| 4 | // distribution is subject to the Boost Software License, Version
|
---|
| 5 | // 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
---|
| 6 | // http://www.boost.org/LICENSE_1_0.txt)
|
---|
| 7 |
|
---|
| 8 | // See http://www.boost.org for updates, documentation, and revision history.
|
---|
| 9 |
|
---|
| 10 | #ifndef BOOST_STRING_STD_LIST_TRAITS_HPP
|
---|
| 11 | #define BOOST_STRING_STD_LIST_TRAITS_HPP
|
---|
| 12 |
|
---|
| 13 | #include <boost/algorithm/string/yes_no_type.hpp>
|
---|
| 14 | #include <list>
|
---|
| 15 | #include <boost/algorithm/string/sequence_traits.hpp>
|
---|
| 16 |
|
---|
| 17 | namespace boost {
|
---|
| 18 | namespace algorithm {
|
---|
| 19 |
|
---|
| 20 | // std::list<> traits -----------------------------------------------//
|
---|
| 21 |
|
---|
| 22 | #ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
|
---|
| 23 |
|
---|
| 24 | // stable iterators tester
|
---|
| 25 | template<typename T, typename AllocT>
|
---|
| 26 | yes_type has_stable_iterators_tester( const ::std::list<T,AllocT>* );
|
---|
| 27 |
|
---|
| 28 | // const time insert tester
|
---|
| 29 | template<typename T, typename AllocT>
|
---|
| 30 | yes_type has_const_time_insert_tester( const ::std::list<T,AllocT>* );
|
---|
| 31 |
|
---|
| 32 | // const time erase tester
|
---|
| 33 | template<typename T, typename AllocT>
|
---|
| 34 | yes_type has_const_time_erase_tester( const ::std::list<T,AllocT>* );
|
---|
| 35 |
|
---|
| 36 |
|
---|
| 37 | #else // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
|
---|
| 38 |
|
---|
| 39 | // stable iterators trait
|
---|
| 40 | template<typename T, typename AllocT>
|
---|
| 41 | class has_stable_iterators< ::std::list<T,AllocT> >
|
---|
| 42 | {
|
---|
| 43 | public:
|
---|
| 44 | #if BOOST_WORKAROUND( __IBMCPP__, <= 600 )
|
---|
| 45 | enum { value = true };
|
---|
| 46 | #else
|
---|
| 47 | BOOST_STATIC_CONSTANT(bool, value=true);
|
---|
| 48 | #endif // BOOST_WORKAROUND( __IBMCPP__, <= 600 )
|
---|
| 49 | typedef mpl::bool_<has_stable_iterators<T>::value> type;
|
---|
| 50 | };
|
---|
| 51 |
|
---|
| 52 | // const time insert trait
|
---|
| 53 | template<typename T, typename AllocT>
|
---|
| 54 | class has_const_time_insert< ::std::list<T,AllocT> >
|
---|
| 55 | {
|
---|
| 56 | public:
|
---|
| 57 | #if BOOST_WORKAROUND( __IBMCPP__, <= 600 )
|
---|
| 58 | enum { value = true };
|
---|
| 59 | #else
|
---|
| 60 | BOOST_STATIC_CONSTANT(bool, value=true);
|
---|
| 61 | #endif // BOOST_WORKAROUND( __IBMCPP__, <= 600 )
|
---|
| 62 | typedef mpl::bool_<has_const_time_insert<T>::value> type;
|
---|
| 63 | };
|
---|
| 64 |
|
---|
| 65 | // const time erase trait
|
---|
| 66 | template<typename T, typename AllocT>
|
---|
| 67 | class has_const_time_erase< ::std::list<T,AllocT> >
|
---|
| 68 | {
|
---|
| 69 | public:
|
---|
| 70 | #if BOOST_WORKAROUND( __IBMCPP__, <= 600 )
|
---|
| 71 | enum { value = true };
|
---|
| 72 | #else
|
---|
| 73 | BOOST_STATIC_CONSTANT(bool, value=true);
|
---|
| 74 | #endif // BOOST_WORKAROUND( __IBMCPP__, <= 600 )
|
---|
| 75 | typedef mpl::bool_<has_const_time_erase<T>::value> type;
|
---|
| 76 | };
|
---|
| 77 | #endif
|
---|
| 78 |
|
---|
| 79 |
|
---|
| 80 | } // namespace algorithm
|
---|
| 81 | } // namespace boost
|
---|
| 82 |
|
---|
| 83 |
|
---|
| 84 | #endif // BOOST_STRING_STD_LIST_TRAITS_HPP
|
---|