Guest User

Untitled

a guest
May 24th, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.98 KB | None | 0 0
  1. namespace cv
  2. {
  3. //matrix object derived from cv::Mat
  4. class Mvbl_Mat final: public Mat
  5. {
  6. public:
  7. //constructors
  8. Mvbl_Mat(){};
  9. Mvbl_Mat(int rows, int cols, int type, const Scalar &s):Mat(rows, cols, type, s){}
  10. //destructor
  11. ~Mvbl_Mat(){};
  12.  
  13. //move constructor
  14. Mvbl_Mat(Mvbl_Mat && other) noexcept
  15. {
  16. this->data=other.data;
  17. other.data=nullptr;
  18. }
  19. //move assignment operator
  20. Mvbl_Mat & operator=(Mvbl_Mat && other)
  21. {
  22. this->data=other.data;
  23. other.data=nullptr;
  24. return *this;
  25. }
  26. };
  27.  
  28. }
  29.  
  30. namespace std
  31. {
  32. //specialization of std::move for cv::Mvbl_Mat
  33. template<>
  34. constexpr typename std::remove_reference<cv::Mvbl_Mat>::type&&
  35. move(cv::Mvbl_Mat&& __t)
  36. {
  37. return static_cast<typename std::remove_reference<cv::Mvbl_Mat>::type&&>(__t);
  38. }
  39. }
Add Comment
Please, Sign In to add comment