[client,sdl] fix move constructors

use default implementation to avoid use after move
This commit is contained in:
akallabeth 2024-10-29 13:03:25 +01:00
parent 6548f1f9dd
commit 3c9a45e9d0
No known key found for this signature in database
GPG Key ID: A49454A3FC909FD5
4 changed files with 4 additions and 18 deletions

View File

@ -36,10 +36,7 @@ SdlButton::SdlButton(SDL_Renderer* renderer, std::string label, int id, SDL_Rect
update_text(renderer, _name, buttonfontcolor, buttonbackgroundcolor);
}
SdlButton::SdlButton(SdlButton&& other) noexcept
: SdlWidget(std::move(other)), _name(std::move(other._name)), _id(other._id)
{
}
SdlButton::SdlButton(SdlButton&& other) noexcept = default;
SdlButton::~SdlButton() = default;

View File

@ -42,11 +42,7 @@ SdlSelectWidget::SdlSelectWidget(SDL_Renderer* renderer, std::string label, SDL_
update_text(renderer);
}
SdlSelectWidget::SdlSelectWidget(SdlSelectWidget&& other) noexcept
: SdlWidget(std::move(other)), _text(std::move(other._text)), _mouseover(other._mouseover),
_highlight(other._highlight)
{
}
SdlSelectWidget::SdlSelectWidget(SdlSelectWidget&& other) noexcept = default;
SdlSelectWidget::~SdlSelectWidget() = default;

View File

@ -36,10 +36,7 @@ SdlButton::SdlButton(SDL_Renderer* renderer, std::string label, int id, const SD
update_text(renderer, _name, buttonfontcolor, buttonbackgroundcolor);
}
SdlButton::SdlButton(SdlButton&& other) noexcept
: SdlWidget(std::move(other)), _name(std::move(other._name)), _id(other._id)
{
}
SdlButton::SdlButton(SdlButton&& other) noexcept = default;
SdlButton::~SdlButton() = default;

View File

@ -42,11 +42,7 @@ SdlSelectWidget::SdlSelectWidget(SDL_Renderer* renderer, std::string label, cons
update_text(renderer);
}
SdlSelectWidget::SdlSelectWidget(SdlSelectWidget&& other) noexcept
: SdlWidget(std::move(other)), _text(std::move(other._text)), _mouseover(other._mouseover),
_highlight(other._highlight)
{
}
SdlSelectWidget::SdlSelectWidget(SdlSelectWidget&& other) noexcept = default;
bool SdlSelectWidget::set_mouseover(SDL_Renderer* renderer, bool mouseOver)
{