File indexing completed on 2025-01-18 09:40:55
0001 #ifndef BOOST_MP11_DETAIL_MPL_COMMON_HPP_INCLUDED
0002 #define BOOST_MP11_DETAIL_MPL_COMMON_HPP_INCLUDED
0003
0004
0005
0006
0007
0008
0009
0010
0011 #include <boost/mp11/list.hpp>
0012 #include <boost/mp11/algorithm.hpp>
0013
0014 namespace boost
0015 {
0016 namespace mpl
0017 {
0018
0019 struct forward_iterator_tag;
0020
0021 namespace aux
0022 {
0023
0024 struct mp11_tag {};
0025
0026 template<class L> struct mp11_iterator
0027 {
0028 using category = forward_iterator_tag;
0029
0030 using type = mp11::mp_first<L>;
0031 using next = mp11_iterator<mp11::mp_rest<L>>;
0032 };
0033
0034 }
0035
0036
0037
0038 template< typename Tag > struct at_impl;
0039
0040 template<> struct at_impl<aux::mp11_tag>
0041 {
0042 template<class L, class I> struct apply
0043 {
0044 using type = mp11::mp_at<L, I>;
0045 };
0046 };
0047
0048
0049
0050 template< typename Tag > struct back_impl;
0051
0052 template<> struct back_impl<aux::mp11_tag>
0053 {
0054 template<class L> struct apply
0055 {
0056 using N = mp11::mp_size<L>;
0057 using type = mp11::mp_at_c<L, N::value - 1>;
0058 };
0059 };
0060
0061
0062
0063 template< typename Tag > struct begin_impl;
0064
0065 template<> struct begin_impl<aux::mp11_tag>
0066 {
0067 template<class L> struct apply
0068 {
0069 using type = aux::mp11_iterator<L>;
0070 };
0071 };
0072
0073
0074
0075 template< typename Tag > struct clear_impl;
0076
0077 template<> struct clear_impl<aux::mp11_tag>
0078 {
0079 template<class L> struct apply
0080 {
0081 using type = mp11::mp_clear<L>;
0082 };
0083 };
0084
0085
0086
0087 template< typename Tag > struct end_impl;
0088
0089 template<> struct end_impl<aux::mp11_tag>
0090 {
0091 template<class L> struct apply
0092 {
0093 using type = aux::mp11_iterator<mp11::mp_clear<L>>;
0094 };
0095 };
0096
0097
0098
0099 template< typename Tag > struct front_impl;
0100
0101 template<> struct front_impl<aux::mp11_tag>
0102 {
0103 template<class L> struct apply
0104 {
0105 using type = mp11::mp_front<L>;
0106 };
0107 };
0108
0109
0110
0111 template< typename Tag > struct pop_front_impl;
0112
0113 template<> struct pop_front_impl<aux::mp11_tag>
0114 {
0115 template<class L> struct apply
0116 {
0117 using type = mp11::mp_pop_front<L>;
0118 };
0119 };
0120
0121
0122
0123 template< typename Tag > struct push_back_impl;
0124
0125 template<> struct push_back_impl<aux::mp11_tag>
0126 {
0127 template<class L, class T> struct apply
0128 {
0129 using type = mp11::mp_push_back<L, T>;
0130 };
0131 };
0132
0133
0134
0135 template< typename Tag > struct push_front_impl;
0136
0137 template<> struct push_front_impl<aux::mp11_tag>
0138 {
0139 template<class L, class T> struct apply
0140 {
0141 using type = mp11::mp_push_front<L, T>;
0142 };
0143 };
0144
0145
0146
0147 template< typename Tag > struct size_impl;
0148
0149 template<> struct size_impl<aux::mp11_tag>
0150 {
0151 template<class L> struct apply
0152 {
0153 using type = mp11::mp_size<L>;
0154 };
0155 };
0156
0157 }
0158 }
0159
0160 #endif