Use std::shared_ptr to manage categories
Categories get merged and destroyed normally which makes the code a bit fiddly. Let std::shared_ptr take care of the lifetime of such objects rather than doing it by ourselves.
Categories get merged and destroyed normally which makes the code a bit fiddly. Let std::shared_ptr take care of the lifetime of such objects rather than doing it by ourselves.