Closed dinghram closed 6 years ago
Good point - fixed.
Thanks
On Thu, Jun 21, 2018 at 12:55 AM mattreecebentley notifications@github.com wrote:
Good point - fixed.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/mattreecebentley/plf_list/issues/10#issuecomment-398996173, or mute the thread https://github.com/notifications/unsubscribe-auth/AWCfOcneYetwqS1FuPCmKWrZmG9XM_xFks5t-0NXgaJpZM4UwCS7 .
With std::list, I can use a functor with a non-const operator() when sorting. This can be helpful when the compare has to build some temporary data per item (like a display name), caching the value internally so that it doesn't have to build the display name every time that record is compared during the sort.
This can be fixed by adding a second, non-const operator() in sort_dereferencer with the same code as the const version. I am not sure this works on all compilers/platforms.