diff --git a/include/etl/array.h b/include/etl/array.h
index efb2ce04..f1624209 100644
--- a/include/etl/array.h
+++ b/include/etl/array.h
@@ -1136,7 +1136,7 @@ namespace etl
///\return true if the arrays are equal, otherwise false
//*************************************************************************
template
- bool operator ==(const etl::array& lhs, const etl::array& rhs)
+ ETL_CONSTEXPR14 bool operator ==(const etl::array& lhs, const etl::array& rhs)
{
return etl::equal(lhs.cbegin(), lhs.cend(), rhs.cbegin());
}
@@ -1148,7 +1148,7 @@ namespace etl
///\return true if the arrays are not equal, otherwise false
//*************************************************************************
template
- bool operator !=(const etl::array& lhs, const etl::array& rhs)
+ ETL_CONSTEXPR14 bool operator !=(const etl::array& lhs, const etl::array& rhs)
{
return !(lhs == rhs);
}
diff --git a/test/test_array.cpp b/test/test_array.cpp
index 9edd0719..27eaf674 100644
--- a/test/test_array.cpp
+++ b/test/test_array.cpp
@@ -631,6 +631,16 @@ namespace
CHECK(data1 == data2);
}
+ //*************************************************************************
+ TEST(test_equal_constexpr)
+ {
+ ETL_CONSTEXPR14 Data data1 = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
+ ETL_CONSTEXPR14 Data data2 = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
+
+ ETL_CONSTEXPR14 bool result = (data1 == data2);
+ CHECK(result);
+ }
+
//*************************************************************************
TEST(test_not_equal)
{
@@ -640,6 +650,16 @@ namespace
CHECK(data1 != data2);
}
+ //*************************************************************************
+ TEST(test_not_equal_constexpr)
+ {
+ ETL_CONSTEXPR14 Data data1 = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
+ ETL_CONSTEXPR14 Data data2 = { 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 };
+
+ ETL_CONSTEXPR14 bool result = (data1 != data2);
+ CHECK(result);
+ }
+
//*************************************************************************
TEST(test_less_than)
{