1 #ifndef VCSN_CORE_CRANGE_HH
2 # define VCSN_CORE_CRANGE_HH
5 # include <type_traits>
7 # include <boost/iterator/filter_iterator.hpp>
16 using unref_C =
typename std::remove_reference<C>::type;
28 #define DEFINE(Name) \
29 auto Name() const -> decltype(this->cont_.Name()) \
31 return cont_.Name(); \
51 using unref_C =
typename std::remove_reference<C>::type;
55 = boost::filter_iterator<predicate_t, typename unref_C::const_iterator>;
99 return std::distance(
begin(),
end());
108 #endif // !VCSN_CORE_CRANGE_HH
auto begin() const -> decltype(this->cont_.begin())
Restrict the interface of a container to begin/end.
typename unref_C::value_type value_type
value_type back() const
The last element.
auto empty() const -> decltype(this->cont_.empty())
typename std::remove_reference< C >::type unref_C
const_iterator begin() const
auto size() const -> decltype(this->cont_.size())
value_type front() const
The first element.
std::function< bool(value_type)> predicate_t
container_range(const unref_C &cont)
auto end() const -> decltype(this->cont_.end())
typename std::remove_reference< C >::type unref_C
typename unref_C::const_iterator const_iterator
#define DEFINE(Name)
Forward function Name to the container.
auto back() const -> decltype(this->cont_.back())
The last element.
const_iterator end() const
boost::filter_iterator< predicate_t, typename unref_C::const_iterator > const_iterator
container_filter_range(const unref_C &cont, predicate_t predicate)
typename unref_C::value_type value_type
auto front() const -> decltype(this->cont_.front())
The first element.