mirror of
https://github.com/slsdetectorgroup/aare.git
synced 2026-02-20 04:18:40 +01:00
view is only allowed on l-value frame (#220)
Vadym accidentally called view() directly on an R-value frame, which leads to a dangling view pointer. Adjusted code such that compiler throws an error if called on an R-value frame. Co-authored-by: Erik Fröjdh <erik.frojdh@psi.ch>
This commit is contained in:
@@ -105,7 +105,7 @@ class Frame {
|
||||
* @tparam T type of the pixels
|
||||
* @return NDView<T, 2>
|
||||
*/
|
||||
template <typename T> NDView<T, 2> view() {
|
||||
template <typename T> NDView<T, 2> view() & {
|
||||
std::array<ssize_t, 2> shape = {static_cast<ssize_t>(m_rows),
|
||||
static_cast<ssize_t>(m_cols)};
|
||||
T *data = reinterpret_cast<T *>(m_data);
|
||||
|
||||
Reference in New Issue
Block a user