[IMPR] getImpl() returns a reference
Compare changes
Making Tensor::getImpl()
return a reference to a TensorImpl
.
On "client" side it displays the guarantee that an implementation is actually returned whereas returning a pointer (even a smart one) leaves the risk of a null one.
(In order to go further, Tensor::getImpl()
should check itself the validity of the implementation and call AIDGE_THROW_OR_ABORT
itself).
Beside I couldn't see a valid reason to return a reference to std::unique_ptr
std::unique_ptr
is replaced by a std::shared_ptr
. In this case, it is debatable if a shared or weak pointer should be returned instead of a plain reference.Copyright © Eclipse Foundation, Inc. All Rights Reserved. Privacy Policy | Terms of Use | Copyright Agent