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

[DDMD] Fix Issue 10724 - Allow slice of string literal to convert to const(char)* #2392

Merged
merged 1 commit into from
Jul 28, 2013

Conversation

yebblies
Copy link
Member

I sorta need this for DDMD so I can strip the newline from the version file:

const(char)* _version = "v" ~ import("VERSION")[0..$-1];

http://d.puremagic.com/issues/show_bug.cgi?id=10724

WalterBright added a commit that referenced this pull request Jul 28, 2013
[DDMD] Fix Issue 10724 - Allow slice of string literal to convert to const(char)*
@WalterBright WalterBright merged commit e230276 into dlang:master Jul 28, 2013
@yebblies yebblies deleted the issue10724 branch July 29, 2013 08:44
@denis-sh
Copy link
Contributor

IMHO, needlesly complicates the language. Any discussions/documentation for it?

@yebblies
Copy link
Member Author

There is plenty of precedent for this. Do you have any reasons to justify your opinion?

@denis-sh
Copy link
Contributor

Do you have any reasons to justify your opinion?

No. If it is obviously legitimate for you and doesn't need any discussion I will agree. But documentation is needed.

@yebblies
Copy link
Member Author

Ok. To me, this is an extension of the existing string literal -> const char* + zero termination rule. I think it is reasonable to apply this to the result of constant folding.

@yebblies yebblies added the DDMD label Jul 28, 2014
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