c++17 move operators etc. for the Math classes
[platform/core/uifw/dali-core.git] / dali / public-api / math / matrix.cpp
index 18107c1..b1a33bd 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -133,6 +133,20 @@ Matrix& Matrix::operator=( const Matrix& matrix )
   return *this;
 }
 
+Matrix::Matrix( Matrix&& matrix )
+{
+  memcpy( mMatrix, matrix.mMatrix, NUM_BYTES_IN_MATRIX );
+}
+
+Matrix& Matrix::operator=( Matrix&& matrix )
+{
+  if( this != &matrix )
+  {
+    memcpy( mMatrix, matrix.mMatrix, NUM_BYTES_IN_MATRIX );
+  }
+  return *this;
+}
+
 void Matrix::InvertTransform(Matrix& result) const
 {
   MATH_INCREASE_BY(PerformanceMonitor::FLOAT_POINT_MULTIPLY,12);