Skip to content

Commit

Permalink
drops init list support from filter
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanhaining committed Apr 8, 2016
1 parent 8d29587 commit 2e5e372
Showing 1 changed file with 0 additions and 23 deletions.
23 changes: 0 additions & 23 deletions filter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

#include <utility>
#include <iterator>
#include <initializer_list>

namespace iter {
namespace impl {
Expand All @@ -16,9 +15,6 @@ namespace iter {
template <typename FilterFunc, typename Container>
impl::Filtered<FilterFunc, Container> filter(FilterFunc, Container&&);

template <typename FilterFunc, typename T>
impl::Filtered<FilterFunc, std::initializer_list<T>> filter(
FilterFunc, std::initializer_list<T>);
}

template <typename FilterFunc, typename Container>
Expand All @@ -30,10 +26,6 @@ class iter::impl::Filtered {
// The filter function is the only thing allowed to create a Filtered
friend Filtered iter::filter<FilterFunc, Container>(FilterFunc, Container&&);

template <typename FF, typename T>
friend Filtered<FF, std::initializer_list<T>> iter::filter(
FF, std::initializer_list<T>);

// Value constructor for use only in the filter function
Filtered(FilterFunc in_filter_func, Container&& in_container)
: container(std::forward<Container>(in_container)),
Expand Down Expand Up @@ -123,20 +115,10 @@ iter::impl::Filtered<FilterFunc, Container> iter::filter(
return {filter_func, std::forward<Container>(container)};
}

template <typename FilterFunc, typename T>
iter::impl::Filtered<FilterFunc, std::initializer_list<T>> iter::filter(
FilterFunc filter_func, std::initializer_list<T> il) {
return {filter_func, std::move(il)};
}

namespace iter {
namespace detail {

template <typename T>
bool boolean_cast(const T& t) {
return bool(t);
}

template <typename Container>
class BoolTester {
public:
Expand All @@ -152,11 +134,6 @@ namespace iter {
detail::BoolTester<Container>(), std::forward<Container>(container));
}

template <typename T>
auto filter(std::initializer_list<T> il) {
return filter(
detail::BoolTester<std::initializer_list<T>>(), std::move(il));
}
}

#endif

0 comments on commit 2e5e372

Please sign in to comment.