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
In this example, function names are written down in the order they are called, so it looks much cleaner. Probably if we could have UFCS, this wouldn't be needed.
In real world these functions could be lambdas written in-line and consisting of several lines, so this order inconsistency may look really ugly.
The text was updated successfully, but these errors were encountered:
Imagine a scenario where a several transformations have to be applied to an optional:
Currently this is done in this way, where orders in which functions are written and applied is inconsistent:
I propose adding a trivial member function
apply(F f)
tooptional
that applies f to*this
, so the code above can be written as:In this example, function names are written down in the order they are called, so it looks much cleaner. Probably if we could have UFCS, this wouldn't be needed.
In real world these functions could be lambdas written in-line and consisting of several lines, so this order inconsistency may look really ugly.
The text was updated successfully, but these errors were encountered: