DGtal-team / DGtal

Digital Geometry Tools and Algorithm Library
https://dgtal.org
GNU Lesser General Public License v3.0
370 stars 116 forks source link

On owning or aliasing pointers #774

Open troussil opened 10 years ago

troussil commented 10 years ago

I saw that three classes do similar things: CounterPtrOrPtr CountedConstPtrOrConstPtr OwningOrAliasingPtr They use a bool to let the user decide whether the object must own the data or just alias the data.

Maybe we can refactor the code with one class templated by a smart pointer (either a CowPtr, or a CounterPtr or any other smart pointers that own the data).

By the way, I think that we should write CPointer and CSmartPointers concepts.

JacquesOlivierLachaud commented 10 years ago

I suggest to postpone it. We need to discuss a precise refactoring.