decay map/filter callbacks before storing them

master
Daniel Kolesa 2016-05-09 00:07:25 +01:00
parent ccaedf80dc
commit 65954f614c
1 changed files with 3 additions and 3 deletions

View File

@ -661,7 +661,7 @@ struct MapRange: InputRange<
> { > {
private: private:
T p_range; T p_range;
F p_func; Decay<F> p_func;
public: public:
MapRange() = delete; MapRange() = delete;
@ -757,7 +757,7 @@ struct FilterRange: InputRange<
> { > {
private: private:
T p_range; T p_range;
F p_pred; Decay<F> p_pred;
void advance_valid() { void advance_valid() {
while (!p_range.empty() && !p_pred(front())) p_range.pop_front(); while (!p_range.empty() && !p_pred(front())) p_range.pop_front();
@ -816,7 +816,7 @@ namespace detail {
template<typename R, typename P> template<typename R, typename P>
inline FilterRange<R, detail::FilterPred<R, P>> filter(R range, P pred) { inline FilterRange<R, detail::FilterPred<R, P>> filter(R range, P pred) {
return FilterRange<R, P>(range, pred); return FilterRange<R, P>(range, move(pred));
} }
template<typename F> template<typename F>