diff --git a/include/podio/Reader.h b/include/podio/Reader.h index 8484fc1b2..e644a8238 100644 --- a/include/podio/Reader.h +++ b/include/podio/Reader.h @@ -22,7 +22,7 @@ class Reader { template struct ReaderModel final : public ReaderConcept { - ReaderModel(T* reader) : m_reader(reader) { + ReaderModel(std::unique_ptr reader) : m_reader(std::move(reader)) { } ReaderModel(const ReaderModel&) = delete; ReaderModel& operator=(const ReaderModel&) = delete; diff --git a/src/Reader.cc b/src/Reader.cc index 3684634f9..2686419b8 100644 --- a/src/Reader.cc +++ b/src/Reader.cc @@ -15,7 +15,7 @@ namespace podio { template -Reader::Reader(std::unique_ptr reader) : m_self(std::make_unique>(reader.release())) { +Reader::Reader(std::unique_ptr reader) : m_self(std::make_unique>(std::move(reader))) { } Reader makeReader(const std::string& filename) {