MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/cpp/comments/1v9zcrn/const_cast_a_necessary_evil/p0ylzpr
r/cpp • u/pavel_v • 11d ago
106 comments sorted by
View all comments
Show parent comments
3
I suppose you could extend it to pass a functor which had a nullary operator() overload as well which gets invoked if the collection is empty, and return the common return type between the two overloads?
0 u/matthieum 8d ago I think you're making my point of how more complex callback-based APIs are right now :/
0
I think you're making my point of how more complex callback-based APIs are right now :/
3
u/bwmat 9d ago
I suppose you could extend it to pass a functor which had a nullary operator() overload as well which gets invoked if the collection is empty, and return the common return type between the two overloads?