mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-22 23:52:03 +00:00
Fixed build [#CLICKHOUSE-2].
This commit is contained in:
parent
9c96d5c2ab
commit
33f56fc035
@ -6,12 +6,14 @@
|
|||||||
template <typename F, typename C>
|
template <typename F, typename C>
|
||||||
struct RangeFiltered
|
struct RangeFiltered
|
||||||
{
|
{
|
||||||
using RawIterator = typename C::iterator;
|
/// Template parameter C may be const. Then const_iterator is used.
|
||||||
|
using RawIterator = decltype(std::declval<C>().begin());
|
||||||
class Iterator;
|
class Iterator;
|
||||||
|
|
||||||
/// Will iterate over elements for which filter(*it) == true
|
/// Will iterate over elements for which filter(*it) == true
|
||||||
RangeFiltered(F && filter, const C & container)
|
template <typename F_, typename C_> /// Another template for universal references to work.
|
||||||
: filter(std::move(filter)), container(container) {}
|
RangeFiltered(F_ && filter, C_ && container)
|
||||||
|
: filter(std::move(filter)), container(container) {}
|
||||||
|
|
||||||
Iterator begin() const
|
Iterator begin() const
|
||||||
{
|
{
|
||||||
@ -114,12 +116,12 @@ struct RangeFiltered
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
F filter;
|
F filter;
|
||||||
const C & container;
|
C & container;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
template <typename F, typename C>
|
template <typename F, typename C>
|
||||||
inline RangeFiltered<std::decay_t<F>, std::decay_t<C>> createRangeFiltered(F && filter, C && container)
|
inline RangeFiltered<std::decay_t<F>, std::remove_reference_t<C>> createRangeFiltered(F && filter, C && container)
|
||||||
{
|
{
|
||||||
return {std::forward<F>(filter), std::forward<C>(container)};
|
return {std::forward<F>(filter), std::forward<C>(container)};
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user