Factory functions should return unique pointers

Issue #879 new
Jan Blechta created an issue

It is natural that all factory functions (linear algebra factories, mesh generation factories, etc.) return std::unique_ptr. That can be converted to std::shared_ptr if needed then.

This might not have any noticeable performance improvements but it improves semantics of the interface. The question is how SWIG likes this change.

Comments (1)

  1. Prof Garth Wells

    This would be simpler when moving to C++14 so we can use std::make_unqiue.

    pybind11 (which will replace SWIG) supports unique_ptr.

  2. Log in to comment