You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While std::priority_queue can be instantiated with unique pointers, it isn't usable in practice, because of the way the top() and pop() methods interact with each other. This forces the user to either go the shared_ptr route (an overkill in many cases) or the raw pointer one, explicitly doing memory management on the application side, historically an error-prone endeavor. As neither of these alternatives is completely satisfactory, we should explore the possibility of a heap abstraction that resolves this conundrum.
The text was updated successfully, but these errors were encountered:
While std::priority_queue can be instantiated with unique pointers, it isn't usable in practice, because of the way the top() and pop() methods interact with each other. This forces the user to either go the shared_ptr route (an overkill in many cases) or the raw pointer one, explicitly doing memory management on the application side, historically an error-prone endeavor. As neither of these alternatives is completely satisfactory, we should explore the possibility of a heap abstraction that resolves this conundrum.
The text was updated successfully, but these errors were encountered: