Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Third attempt at fixing put. I think this could be the good one.
This new version is capable of transcoding any character/string of any width, to any character/string of any width. It does this (if I may say so), rather efficiently too.
This basically "fixes" the totality of
std.format, which sometimes needs to put a dchar in the output stream, made simple code such asformattedWrite((const(char[]) s){}, "%s", "string");fail to compile. Now, we can even do things likeformattedWrite((const(char[]) s){}, "%s", "string"d);(notice the"d). Yay!Added some optimizations for array to array copy too.
For what this does, I also think the "flow" is as simple as we can get it to be. I tripple checked all the code paths, and I made sure using -cov that all roads are taken and validated.
As a helper feature, I defined
doPut, which is "put without any features", and it's corresponding traitisNativeOutputRange. This is used strictly internally, and is not made public to the user.