range fixes

master
Daniel Kolesa 2017-02-18 16:21:03 +01:00
parent 2ce3e6496a
commit d155f90ceb
2 changed files with 7 additions and 1 deletions

View File

@ -776,7 +776,9 @@ inline auto foldr_f(T &&init, F &&func) {
template<typename T, typename F, typename R>
struct map_range: input_range<map_range<T, F, R>> {
using range_category = range_category_t<T>;
using range_category = std::common_type_t<
range_category_t<T>, finite_random_access_range_tag
>;
using value_type = R;
using reference = R;
using size_type = range_size_t<T>;

View File

@ -1729,6 +1729,10 @@ struct iterator_range: input_range<iterator_range<T>> {
reference operator[](size_type i) const { return p_beg[i]; }
/* statisfy contiguous_range */
value_type *data() { return p_beg; }
value_type const *data() const { return p_beg; }
/* satisfy output_range */
bool put(value_type const &v) {
if (empty()) {