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
Isn't that just a matter of a missing an import of std.range.primitives then, or are there cases where relying on UFCS would result in the wrong function to be called (due to all the extra logic in the global one)?
No, unfortunately. This is one of the failures of Phobos. Because the hook to put is called put, it's very easy to use the member instead of the std.range function as UFCS, which means using r.put is going to limit you only to what the type supports. It will work for some ranges, but not others (as evidenced here).
It's also possible to have an output range of dchar that just has a put(dchar) member, which means the textfilter modules won't compile with that output range, even though isOutputRange!(R, dchar) is true.
The annoying answer is, you can't use put via UFCS in implementations, you have to call it as a standalone function to make sure it's properly used.
I can make a PR, just wanted to leave this issue report here so it's not forgotten.