26#ifndef RESOURCEHOLDER_H
27#define RESOURCEHOLDER_H
32 std::unique_ptr<T>
object =
nullptr;
38 object = original_object->make_copy();
43 : object(old_holder.object ? old_holder.object->make_copy() : nullptr) {}
50 T* operator->()
const {
return object.get(); }
52 explicit operator bool()
const {
return object !=
nullptr; }
Definition: ResourceHolder.h:31
ResourceHolder(const ResourceHolder &old_holder)
Definition: ResourceHolder.h:42
ResourceHolder(ResourceHolder &&) noexcept=delete
ResourceHolder & operator=(const std::shared_ptr< T > &original_object)
Definition: ResourceHolder.h:37