Quellcode durchsuchen

Fixing minor issues/pattern failures.

Samuel Jaffe vor 8 Jahren
Ursprung
Commit
a1de3c895f
2 geänderte Dateien mit 2 neuen und 2 gelöschten Zeilen
  1. 1 1
      indexed_iterator.hpp
  2. 1 1
      unkeyed_iterator.hpp

+ 1 - 1
indexed_iterator.hpp

@@ -16,7 +16,7 @@ namespace iterator {
     using base_value_type = typename std::iterator_traits<Iterator>::value_type;
     using base_reference = typename std::iterator_traits<Iterator>::reference;
   public:
-    using index_type = typename std::iterator_traits<Iterator>::difference_type;
+    using index_type = std::size_t;
     using value_type = std::pair<index_type, base_value_type>;
     using reference = std::pair<index_type, base_reference>;
     using pointer = void;

+ 1 - 1
unkeyed_iterator.hpp

@@ -42,7 +42,7 @@ namespace iterator {
     bool operator==(unkeyed_iterator const & other) const { return base == other.base; }
     bool operator!=(unkeyed_iterator const & other) const { return base != other.base; }
     bool operator< (unkeyed_iterator const & other) const { return base < other.base; }
-    bool operator<=(unkeyed_iterator const & other) const { return operator<() || operator==(); }
+    bool operator<=(unkeyed_iterator const & other) const { return !(other < *this); }
   private:
     Iterator base;
   };