MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/cpp/comments/1v9zcrn/const_cast_a_necessary_evil/p0ylr2s/
r/cpp • u/pavel_v • Jul 29 '26
106 comments sorted by
View all comments
Show parent comment
1
Oh, I forgot to mention that a precondition of the method would be to have a non-empty collection, for my idea
3 u/bwmat Jul 31 '26 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 Aug 01 '26 I think you're making my point of how more complex callback-based APIs are right now :/
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 Aug 01 '26 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 :/
View all comments
Show parent comment
1
u/bwmat Jul 31 '26
Oh, I forgot to mention that a precondition of the method would be to have a non-empty collection, for my idea