list {
                  
                  
                      template <
                  
                  
                          typename U = T,
                  
                  
                          typename = std::enable_if_t<std::is_same_v<std::remove_const_t<U>, T>>
                  
                  
                      >
                  
                  
                      class iterator_ {
                  
                  
                          [[nodiscard]] bool operator==(const iterator_& other) const;
                  
                  
                      };
                  
                  
                  };
                  
                  
                  
                  
                  
                  Как определить operator== вне классов? Ругается, когда делаю 
                  
                  
                  template <typename T, typename Allocator>
                  
                  
                  template <typename U, typename>
                  
                  
                  bool list<T, Allocator>::iterator_<U>::operator==(const list<T, Allocator>::iterator_& other) const {
                  
                  
                      return false;
                  
                  
                  }
                  
                  
                
Зачем так извращаться? template <bool IsConst>
Обсуждают сегодня