12template <
typename Value>
17 using RawIterator =
decltype(std::declval<Value>().begin());
21 typename RawIterator::reference value;
24 using iterator_category = std::forward_iterator_tag;
25 using difference_type = std::ptrdiff_t;
29 explicit Iterator(RawIterator it) : it_(it) {}
36 ItValue operator*()
const {
return {it_.GetName(), *it_}; }
38 Iterator operator++(
int) {
43 Iterator& operator++() {
48 bool operator==(
const Iterator& other)
const {
return it_ == other.it_; }
50 bool operator!=(
const Iterator& other)
const {
return !(*
this == other); }
56 ItemsWrapper(Value&& value) : value_(static_cast<Value&&>(value)) {}
58 auto begin()
const {
return cbegin(); }
59 auto end()
const {
return cend(); }
60 auto cbegin()
const {
return Iterator(value_.begin()); }
61 auto cend()
const {
return Iterator(value_.end()); }
67template <
typename Value>
68inline auto Items(Value&& value) {
71 return ItemsWrapper<Value>(
static_cast<Value&&
>(value));