mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 23:27:43 +00:00
LibGfx: Implement copy-assign for Matrix
This used to generate a warning about using a deprecated copy-assign, default-generated by the compiler, and deprecated because we hand- implement the copy-constructor. This warning is correct, since the default-generated copy-assign may or may not be as efficient as memcpy. This patch gets rid of the warning, and has either no performance impact or a slightly positive one. If this turns out to be wrong, we should probably also fix the copy-constructor.
This commit is contained in:
parent
fd8300e52d
commit
ee18912373
1 changed files with 6 additions and 0 deletions
|
@ -38,6 +38,12 @@ public:
|
|||
__builtin_memcpy(m_elements, other.elements(), sizeof(T) * N * N);
|
||||
}
|
||||
|
||||
Matrix& operator=(const Matrix& other)
|
||||
{
|
||||
__builtin_memcpy(m_elements, other.elements(), sizeof(T) * N * N);
|
||||
return *this;
|
||||
}
|
||||
|
||||
constexpr auto elements() const { return m_elements; }
|
||||
constexpr auto elements() { return m_elements; }
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue