From dbc325abf5dc726e08b43f428ae7ad1ee8c09565 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jakub=20Klinkovsk=C3=BD?= <klinkjak@fjfi.cvut.cz>
Date: Tue, 9 Apr 2019 23:28:47 +0200
Subject: [PATCH] Simplified comparison operators in ArrayView

---
 src/TNL/Containers/ArrayView.h   | 26 --------------------------
 src/TNL/Containers/ArrayView.hpp | 30 ++----------------------------
 2 files changed, 2 insertions(+), 54 deletions(-)

diff --git a/src/TNL/Containers/ArrayView.h b/src/TNL/Containers/ArrayView.h
index 57b958421a..db2f1d1063 100644
--- a/src/TNL/Containers/ArrayView.h
+++ b/src/TNL/Containers/ArrayView.h
@@ -374,19 +374,6 @@ public:
    __cuda_callable__
    const Value& operator[]( Index i ) const;
 
-   /**
-    * \brief Comparison operator with another array view \e view.
-    *
-    * \tparam Value_ is the value type of the right-hand-side array view.
-    * \tparam Device_ is the device type of the right-hand-side array view.
-    * \tparam Index_ is the index type of the right-hand-side array view.
-    * \param  view is reference to the right-hand-side array view.
-    *
-    * \return True if both array views are equal element-wise and false otherwise.
-    */
-   template< typename Value_, typename Device_, typename Index_ >
-   bool operator==( const ArrayView< Value_, Device_, Index_ >& view ) const;
-
    /**
     * \brief Comparison operator with another array-like container \e array.
     *
@@ -398,19 +385,6 @@ public:
    template< typename ArrayT >
    bool operator==( const ArrayT& array ) const;
 
-   /**
-    * \brief Comparison negation operator with another array view \e view.
-    *
-    * \tparam Value_ is the value type of the right-hand-side array view.
-    * \tparam Device_ is the device type of the right-hand-side array view.
-    * \tparam Index_ is the index type of the right-hand-side array view.
-    * \param  view is reference to the right-hand-side array view.
-    *
-    * \return True if both array views are not equal element-wise and false otherwise.
-    */
-   template< typename Value_, typename Device_, typename Index_ >
-   bool operator!=( const ArrayView< Value_, Device_, Index_ >& view ) const;
-
    /**
     * \brief Comparison negation operator with another array-like container \e array.
     *
diff --git a/src/TNL/Containers/ArrayView.hpp b/src/TNL/Containers/ArrayView.hpp
index f66fbe2e30..b317977529 100644
--- a/src/TNL/Containers/ArrayView.hpp
+++ b/src/TNL/Containers/ArrayView.hpp
@@ -279,24 +279,9 @@ operator[]( Index i ) const
 template< typename Value,
           typename Device,
           typename Index >
-   template< typename Value_, typename Device_, typename Index_ >
-bool
-ArrayView< Value, Device, Index >::
-operator==( const ArrayView< Value_, Device_, Index_ >& view ) const
-{
-   if( view.getSize() != getSize() )
-      return false;
-   if( getSize() == 0 )
-      return true;
-   return Algorithms::ArrayOperations< Device, Device_ >::compareMemory( getData(), view.getData(), getSize() );
-}
-
-template< typename Value_,
-          typename Device_,
-          typename Index_ >
    template< typename ArrayT >
 bool
-ArrayView< Value_, Device_, Index_ >::
+ArrayView< Value, Device, Index >::
 operator==( const ArrayT& array ) const
 {
    if( array.getSize() != this->getSize() )
@@ -312,20 +297,9 @@ operator==( const ArrayT& array ) const
 template< typename Value,
           typename Device,
           typename Index >
-   template< typename Value_, typename Device_, typename Index_ >
-bool
-ArrayView< Value, Device, Index >::
-operator!=( const ArrayView< Value_, Device_, Index_ >& view ) const
-{
-   return ! ( *this == view );
-}
-
-template< typename Value_,
-          typename Device_,
-          typename Index_ >
    template< typename ArrayT >
 bool
-ArrayView< Value_, Device_, Index_ >::
+ArrayView< Value, Device, Index >::
 operator!=( const ArrayT& array ) const
 {
    return ! ( *this == array );
-- 
GitLab