mirror of
https://github.com/cookiengineer/audacity
synced 2025-08-08 16:11:14 +02:00
Define ArrayOf<T>::reinit
This commit is contained in:
parent
d0d1a7fcb5
commit
2d57549f0c
@ -364,10 +364,7 @@ public:
|
|||||||
ArrayOf() {}
|
ArrayOf() {}
|
||||||
explicit ArrayOf(size_t count, bool initialize = false)
|
explicit ArrayOf(size_t count, bool initialize = false)
|
||||||
{
|
{
|
||||||
if (initialize)
|
reinit(count, initialize);
|
||||||
this->reset(safenew X[count]{});
|
|
||||||
else
|
|
||||||
this->reset(safenew X[count]);
|
|
||||||
}
|
}
|
||||||
ArrayOf(const ArrayOf&) = delete;
|
ArrayOf(const ArrayOf&) = delete;
|
||||||
ArrayOf& operator= (ArrayOf &&that)
|
ArrayOf& operator= (ArrayOf &&that)
|
||||||
@ -380,6 +377,14 @@ public:
|
|||||||
std::unique_ptr<X[]>::operator=(std::move(that));
|
std::unique_ptr<X[]>::operator=(std::move(that));
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void reinit(size_t count, bool initialize = false)
|
||||||
|
{
|
||||||
|
if (initialize)
|
||||||
|
std::unique_ptr<X[]>::reset(safenew X[count]{});
|
||||||
|
else
|
||||||
|
std::unique_ptr<X[]>::reset(safenew X[count]);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user