Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

std.conv, rangify the hexString template and add a run-time overload #4487

Closed
wants to merge 1 commit into from
Closed

std.conv, rangify the hexString template and add a run-time overload #4487

wants to merge 1 commit into from

Conversation

ghost
Copy link

@ghost ghost commented Jun 28, 2016

  • the template and the run-time version always take an input range (vs always a string previously)
  • verify safety and purity in the unittests
  • the result of the runtime version is itself an input range

@JackStouffer
Copy link
Member

foreach (const dchar c; hexData)

This will fail to decode input ranges, so things like paraSep will not be matched. I think you need to pass the range to byDchar.

You also need tests using input ranges.

@ghost
Copy link
Author

ghost commented Jun 28, 2016

@JackStouffer, fixed.

if (hexData.isHexLiteral)
{
immutable hexString = hexStrImpl(hexData);
import std.array: array;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs space before : says style guide

+ verify safety and purity of the unittests
+ the output of the runtime version is itself an input range
@ghost
Copy link
Author

ghost commented Jul 23, 2016

@klickverbot , initially when I've made the template you told me it's just a matter of time before people complain it's not an input range. Fixed now.

@ghost ghost closed this Jul 25, 2016
@ghost ghost deleted the rangify-hexstring branch July 25, 2016 18:18
@ghost
Copy link
Author

ghost commented Feb 8, 2018

ping @WalterBright (https://forum.dlang.org/post/p5gaj5$1hqf$1@digitalmars.com)
I don't know if this one was better ?

This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants