Browse Source

Specialize iterator_traits for TIpAddressRange iterator

```
In file included from $(SOURCE_ROOT)/contrib/libs/cxxsupp/libcxx/include/__algorithm/copy_move_common.h:12:
$(SOURCE_ROOT)/contrib/libs/cxxsupp/libcxx/include/__algorithm/iterator_operations.h:72:3: error: no type named 'value_type' in 'std::iterator_traits<TIpAddressRange::TIterator>'
  using __value_type = typename iterator_traits<_Iter>::value_type;
  ^~~~~
$(SOURCE_ROOT)/contrib/libs/cxxsupp/libcxx/include/__algorithm/copy_move_common.h:149:62: note: in instantiation of template type alias '__value_type' requested here
    using _InValue = typename _IterOps<_AlgPolicy>::template __value_type<_InIter>;
```
hiddenpath 1 year ago
parent
commit
de1073ebfe
1 changed files with 5 additions and 0 deletions
  1. 5 0
      library/cpp/ipmath/ipmath.h

+ 5 - 0
library/cpp/ipmath/ipmath.h

@@ -152,6 +152,11 @@ private:
 
 class TIpAddressRange::TIterator {
 public:
+    using value_type = TIpv6Address;
+    using difference_type = std::ptrdiff_t;
+    using reference = TIpv6Address&;
+    using iterator_category = std::forward_iterator_tag;
+
     TIterator(TIpv6Address val) noexcept;
 
     bool operator==(const TIpAddressRange::TIterator& other) noexcept;