Skip to content
Snippets Groups Projects
Commit dffffa3b authored by Stéphane Del Pino's avatar Stéphane Del Pino
Browse files

Use default affectation and default constructor

This simplifies a bit the code but more importantly makes TinyVector and
TinyMatrix to satisfy std::is_trivial traits
parent 29451096
No related branches found
No related tags found
1 merge request!11Feature/mpi
......@@ -219,13 +219,7 @@ public:
}
PASTIS_INLINE
constexpr TinyMatrix& operator=(const TinyMatrix& A) noexcept
{
for (size_t i=0; i<N*N; ++i) {
m_values[i] = A.m_values[i];
}
return *this;
}
constexpr TinyMatrix& operator=(const TinyMatrix& A) noexcept = default;
PASTIS_INLINE
constexpr TinyMatrix& operator=(TinyMatrix&& A) noexcept = default;
......@@ -239,10 +233,7 @@ public:
}
PASTIS_INLINE
constexpr TinyMatrix() noexcept
{
;
}
constexpr TinyMatrix() noexcept = default;
PASTIS_INLINE
constexpr TinyMatrix(const ZeroType& z) noexcept
......@@ -265,12 +256,7 @@ public:
}
PASTIS_INLINE
constexpr TinyMatrix(const TinyMatrix& A) noexcept
{
for (size_t i=0; i<N*N; ++i) {
m_values[i] = A.m_values[i];
}
}
constexpr TinyMatrix(const TinyMatrix&) noexcept = default;
PASTIS_INLINE
TinyMatrix(TinyMatrix&& A) noexcept = default;
......
......@@ -184,13 +184,7 @@ class TinyVector
}
PASTIS_INLINE
const TinyVector& operator=(const TinyVector& v) noexcept
{
for (size_t i=0; i<N; ++i) {
m_values[i] = v.m_values[i];
}
return *this;
}
TinyVector& operator=(const TinyVector&) noexcept = default;
PASTIS_INLINE
constexpr TinyVector& operator=(TinyVector&& v) noexcept = default;
......@@ -204,10 +198,7 @@ class TinyVector
}
PASTIS_INLINE
constexpr TinyVector() noexcept
{
;
}
constexpr TinyVector() noexcept = default;
PASTIS_INLINE
constexpr TinyVector(const ZeroType& z) noexcept
......@@ -219,12 +210,7 @@ class TinyVector
}
PASTIS_INLINE
constexpr TinyVector(const TinyVector& v) noexcept
{
for (size_t i=0; i<N; ++i) {
m_values[i] = v.m_values[i];
}
}
constexpr TinyVector(const TinyVector&) noexcept = default;
PASTIS_INLINE
constexpr TinyVector(TinyVector&& v) noexcept = default;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment