mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-10-31 15:20:10 +00:00
Fix ArrayStringParameters with move assignment/construction
This commit is contained in:
parent
d80820932f
commit
c4f7794597
@ -203,13 +203,30 @@ public:
|
||||
*/
|
||||
template <size_t N>
|
||||
class ArrayStringParameters : public StringParameters {
|
||||
std::array<StringParameter, N> params = {}; ///< The actual parameters
|
||||
std::array<StringParameter, N> params{}; ///< The actual parameters
|
||||
|
||||
public:
|
||||
ArrayStringParameters()
|
||||
{
|
||||
this->parameters = span(params.data(), params.size());
|
||||
}
|
||||
|
||||
ArrayStringParameters(ArrayStringParameters&& other) noexcept
|
||||
{
|
||||
*this = std::move(other);
|
||||
}
|
||||
|
||||
ArrayStringParameters& operator=(ArrayStringParameters &&other) noexcept
|
||||
{
|
||||
this->offset = other.offset;
|
||||
this->next_type = other.next_type;
|
||||
this->params = std::move(other.params);
|
||||
this->parameters = span(params.data(), params.size());
|
||||
return *this;
|
||||
}
|
||||
|
||||
ArrayStringParameters(const ArrayStringParameters& other) = delete;
|
||||
ArrayStringParameters& operator=(const ArrayStringParameters &other) = delete;
|
||||
};
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user