24 #ifndef VECTOR_HPP_INCLUDED
25 #define VECTOR_HPP_INCLUDED
41 template <
class...Args>
47 typedef vector_tag
tag;
50 typedef std::tuple<Args...>
impl;
56 struct empty_impl<vector_tag> :
vector<> {};
59 struct at_impl<vector_tag>
61 template <
class Seq,
class Pos>
62 struct apply : std::tuple_element<Pos::value, typename Seq::impl> {};
67 template <
class Seq,
class Pos>
75 template <
class Seq,
class Pos>
80 template <
class Seq,
class Pos>
87 struct size_impl<vector_tag>
90 struct apply :
integer<int, std::tuple_size<typename Seq::impl>::value> {};
95 template <
class Seq,
class Pos>
101 struct begin_impl<vector_tag>
103 template <
class Vect>
111 struct end_impl<vector_tag>
113 template <
class Vect>
116 typedef vector_iterator<
118 typename size_impl<vector_tag>::template apply<Vect>::type
124 struct clear_impl<vector_tag>
127 struct apply : vector<> {};
131 template <
class Vect,
class T>
132 struct vector_push_front;
134 template <
class...Args,
class T>
135 struct vector_push_front<vector<Args...>, T> : vector<T, Args...> {};
138 struct push_front_impl<vector_tag>
140 template <
class Vect,
class T>
141 struct apply : vector_push_front<Vect, T> {};
145 template <
class Vect,
class T>
146 struct vector_push_back;
148 template <
class...Args,
class T>
149 struct vector_push_back<vector<Args...>, T> : vector<Args..., T> {};
152 struct push_back_impl<vector_tag>
154 template <
class Seq,
class T>
155 struct apply : vector_push_back<Seq, T> {};
160 template <
class Vect>
161 struct vector_pop_front;
163 template <
class...Args,
class T>
164 struct vector_pop_front<vector<T, Args...> > : vector<Args...> {};
167 struct pop_front_impl<vector_tag>
170 struct apply : vector_pop_front<Seq> {};