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
Sink/Source interfaces declare several member functions that could be easily implemented as extension functions. For example, Source::peek, Source::transferTo, and Sink::transferFrom.
Having such functions implemented as member functions does not provide any obvious benefits but requires us to write similar implementations several times. It would be nice to have a single implementation instead.
The text was updated successfully, but these errors were encountered:
Having such functions implemented as member functions does not provide any obvious benefits
It allows for different implementations to optimize these methods, specifically by offering the option to implement them differently. If those are moved to extension functions, then we face the same hell as with extensions on collections which cannot be easily optimized for specific collection implementations.
Typically, you faced it yourself already: #342, #343
but requires us to write similar implementations several times
I may be missing something, but why not just have a default implementation in the interface itself?
Sink/Source interfaces declare several member functions that could be easily implemented as extension functions. For example,
Source::peek
,Source::transferTo
, andSink::transferFrom
.Having such functions implemented as member functions does not provide any obvious benefits but requires us to write similar implementations several times. It would be nice to have a single implementation instead.
The text was updated successfully, but these errors were encountered: