Skip to content
Snippets Groups Projects
Commit 13aeddd1 authored by Christoph Lehmann's avatar Christoph Lehmann
Browse files

[MaL] assignment operators

 * copy returns *this
 * move explicitly deleted
parent 02448565
No related branches found
No related tags found
No related merge requests found
...@@ -223,12 +223,19 @@ class PETScVector ...@@ -223,12 +223,19 @@ class PETScVector
void setZero() { *this = 0.0; } void setZero() { *this = 0.0; }
/// Overloaded operator: assign /// Overloaded operator: assign
void operator = (const PETScVector &v_in) PETScVector& operator = (const PETScVector &v_in)
{ {
if (!_v) shallowCopy(v_in); if (!_v) shallowCopy(v_in);
VecCopy(*v_in._v, *_v); VecCopy(*v_in._v, *_v);
return *this;
} }
/// Disallow moving.
/// \todo This operator should be implemented properly when doing a
/// general cleanup of all matrix and vector classes.
PETScVector& operator = (PETScVector &&) = delete;
/// Overloaded operator: add /// Overloaded operator: add
void operator += (const PETScVector& v_in) void operator += (const PETScVector& v_in)
{ {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment