sammycage / lunasvg

lunasvg is a standalone SVG rendering library in C++
MIT License
818 stars 115 forks source link

Feature request: Add move semantics to Document type #135

Closed miss-programgamer closed 1 year ago

miss-programgamer commented 1 year ago

Once a document has been created, I'd like to be able to store it somewhere without having to use a unique pointer. If the Document class had move semantics, I would be able to simply transfer it to my own storage, but it currently doesn't

The reason why is because its default constructor is private, meaning the default move constructor is also marked private by default. The fix would be as simple as adding a public Document(Document&&) noexcept; to the Document class in lunasvg.h and lunasvg::Document::Document(Document&&) noexcept = default; in lunasvg.cpp, so please consider this small improvement.

sammycage commented 1 year ago

I appreciate your suggestion and will carefully review it to determine its suitability for integration into the codebase. Thank you for dedicating your time to report the issue and offer a potential solution.