Fix abuse of array2D<>
- Add copy c'tor and assignment to `array2D<>` - Use `std::vector<>` instead of smart pointer to array - Constify a bit - Make use of `rtengine::max(...)`
This commit is contained in:
@@ -64,8 +64,7 @@ constexpr unsigned int ARRAY2D_BYREFERENCE = 2;
|
||||
|
||||
|
||||
template<typename T>
|
||||
class array2D :
|
||||
public rtengine::NonCopyable
|
||||
class array2D
|
||||
{
|
||||
|
||||
private:
|
||||
@@ -125,6 +124,25 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
array2D(const array2D& other) :
|
||||
width(other.width),
|
||||
buffer(other.buffer)
|
||||
{
|
||||
initRows(other.rows.size());
|
||||
}
|
||||
|
||||
array2D& operator =(const array2D& other)
|
||||
{
|
||||
if (this != &other) {
|
||||
free();
|
||||
width = other.width;
|
||||
buffer = other.buffer;
|
||||
initRows(other.rows.size());
|
||||
}
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
void fill(const T val, bool multiThread = false)
|
||||
{
|
||||
const ssize_t height = rows.size();
|
||||
|
Reference in New Issue
Block a user