
On Mon, Dec 16, 2024 at 10:46 PM Ivan Matek
On Mon, Dec 16, 2024 at 6:24 PM Vinnie Falco
wrote: Can this be implemented as a free function over the public API of unordered containers? In other words, this signature:
Yes, but it is not like Barry or other people https://www.youtube.com/watch?feature=shared&t=150&v=kye4aD-KvTU wanting member functions do not know this.
It seems there are two choices here: 1. Add a member function to uncountably many existing and future unordered containers by adding a member function 2. Write a single, separate free function template which works for all existing and future unordered containers The member function requires selecting an optional type and including its header, while the free function approach can scale to different optional types (one per free function). Please explain why we should prefer 1 instead of 2. Thanks