I noticed while messing around with object pools that the current implementation of Clone for Mat leaves the clone_from method to the default implementation. A custom implementation of this function that avoids an extra memory allocation in some generic cases (such as a smart pointer with a handle to an object pool implementing clone by drawing an object from the pool and then using clone_from) should be relatively simple.
I noticed while messing around with object pools that the current implementation of Clone for Mat leaves the clone_from method to the default implementation. A custom implementation of this function that avoids an extra memory allocation in some generic cases (such as a smart pointer with a handle to an object pool implementing clone by drawing an object from the pool and then using clone_from) should be relatively simple.