@@ -32,6 +32,9 @@ struct mir_series
3232 using Index = typename std::remove_reference<decltype (_index[0 ])>::type;
3333 // / Data / Value type aliases
3434 using Data = typename std::remove_reference<decltype (_data._iterator[0 ])>::type;
35+
36+ using UnqualIndex = typename std::remove_all_extents<Index>::type;
37+ using UnqualData = typename std::remove_all_extents<Data>::type;
3538
3639 using Observation = std::pair<Index, Data>;
3740 // using ConstObservation = std::pair<const Index, const Data>;
@@ -92,8 +95,7 @@ struct mir_series
9295 return { {{b - a}, _data._iterator }, std::move (newIndex) };
9396 }
9497
95- template <class T >
96- size_t transition_index_less (const T& val) const
98+ size_t transition_index_less (const Index& val) const
9799 {
98100 size_t first = 0 , count = size ();
99101 while (count > 0 )
@@ -112,8 +114,7 @@ struct mir_series
112114 return first;
113115 }
114116
115- template <class T >
116- size_t transition_index_less_or_equal (const T& val) const
117+ size_t transition_index_less_or_equal (const Index& val) const
117118 {
118119 size_t first = 0 , count = size ();
119120 while (count > 0 )
@@ -132,15 +133,13 @@ struct mir_series
132133 return first;
133134 }
134135
135- template <class T >
136- bool contains (const T& key) const
136+ bool contains (const Index& key) const
137137 {
138138 size_t idx = transition_index_less (key);
139139 return idx < _data._lengths [0 ] && _index[idx] == key;
140140 }
141141
142- template <class T , class Value >
143- bool try_get (const T& key, Value& val) const
142+ bool try_get (const Index& key, UnqualData& val) const
144143 {
145144 size_t idx = transition_index_less (key);
146145 auto cond = idx < _data._lengths [0 ] && _index[idx] == key;
@@ -149,8 +148,7 @@ struct mir_series
149148 return cond;
150149 }
151150
152- template <class T >
153- const Data* try_get_ptr (const T& key) const
151+ const Data* try_get_ptr (const Index& key) const
154152 {
155153 size_t idx = transition_index_less (key);
156154 auto cond = idx < _data._lengths [0 ] && _index[idx] == key;
@@ -159,8 +157,7 @@ struct mir_series
159157 return nullptr ;
160158 }
161159
162- template <class T >
163- auto && get(const T& key)
160+ auto && get(const Index& key)
164161 {
165162 size_t idx = transition_index_less (key);
166163 auto cond = idx < _data._lengths [0 ] && _index[idx] == key;
@@ -169,8 +166,7 @@ struct mir_series
169166 throw std::out_of_range (" series::get: key not found" );
170167 }
171168
172- template <class T >
173- auto && get(const T& key) const
169+ auto && get(const Index& key) const
174170 {
175171 size_t idx = transition_index_less (key);
176172 auto cond = idx < _data._lengths [0 ] && _index[idx] == key;
@@ -179,8 +175,7 @@ struct mir_series
179175 throw std::out_of_range (" series::get: key not found" );
180176 }
181177
182- template <class T , class Value >
183- bool try_get_next (const T& key, Value& val) const
178+ bool try_get_next (const Index& key, UnqualData& val) const
184179 {
185180 size_t idx = transition_index_less (key);
186181 auto cond = idx < _data._lengths [0 ];
@@ -189,8 +184,7 @@ struct mir_series
189184 return cond;
190185 }
191186
192- template <class T , class Value >
193- bool try_get_next_update_key (T& key, Value& val) const
187+ bool try_get_next_update_key (UnqualIndex& key, UnqualData& val) const
194188 {
195189 size_t idx = transition_index_less (key);
196190 auto cond = idx < _data._lengths [0 ];
@@ -202,8 +196,7 @@ struct mir_series
202196 return cond;
203197 }
204198
205- template <class T , class Value >
206- bool try_get_prev (const T& key, Value& val) const
199+ bool try_get_prev (const Index& key, UnqualData& val) const
207200 {
208201 size_t idx = transition_index_less_or_equal (key) - 1 ;
209202 auto cond = 0 <= (ptrdiff_t ) idx;
@@ -212,8 +205,7 @@ struct mir_series
212205 return cond;
213206 }
214207
215- template <class T , class Value >
216- bool try_get_prev_update_key (T& key, Value& val) const
208+ bool try_get_prev_update_key (UnqualIndex& key, UnqualData& val) const
217209 {
218210 size_t idx = transition_index_less_or_equal (key) - 1 ;
219211 auto cond = 0 <= (ptrdiff_t ) idx;
@@ -225,8 +217,7 @@ struct mir_series
225217 return cond;
226218 }
227219
228- template <class T , class Value >
229- bool try_get_first (const T& lowerBound, const T& upperBound, Value& val) const
220+ bool try_get_first (const Index& lowerBound, const Index& upperBound, UnqualData& val) const
230221 {
231222 size_t idx = transition_index_less (lowerBound);
232223 auto cond = idx < _data._lengths [0 ] && _index[idx] <= upperBound;
@@ -235,8 +226,7 @@ struct mir_series
235226 return cond;
236227 }
237228
238- template <class T , class Value >
239- bool try_get_first_update_lower (T& lowerBound, const T& upperBound, Value& val) const
229+ bool try_get_first_update_lower (UnqualIndex& lowerBound, const Index& upperBound, UnqualData& val) const
240230 {
241231 size_t idx = transition_index_less (lowerBound);
242232 auto cond = idx < _data._lengths [0 ] && _index[idx] <= upperBound;
@@ -248,8 +238,7 @@ struct mir_series
248238 return cond;
249239 }
250240
251- template <class T , class Value >
252- bool try_get_last (const T& lowerBound, const T& upperBound, Value& val) const
241+ bool try_get_last (const Index& lowerBound, const Index& upperBound, UnqualData& val) const
253242 {
254243 size_t idx = transition_index_less_or_equal (upperBound) - 1 ;
255244 auto cond = 0 <= (ptrdiff_t ) idx && lowerBound <= _index[idx];
@@ -258,8 +247,7 @@ struct mir_series
258247 return cond;
259248 }
260249
261- template <class T , class Value >
262- bool try_get_last_update_upper (const T& lowerBound, T& upperBound, Value& val) const
250+ bool try_get_last_update_upper (const Index& lowerBound, UnqualIndex& upperBound, UnqualData& val) const
263251 {
264252 size_t idx = transition_index_less_or_equal (upperBound) - 1 ;
265253 auto cond = 0 <= (ptrdiff_t ) idx && lowerBound <= _index[idx];
0 commit comments