[Issue 14042] New: std.conv.to of a immutable char pointer
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Sat Jan 24 18:41:26 PST 2015
https://issues.dlang.org/show_bug.cgi?id=14042
Issue ID: 14042
Summary: std.conv.to of a immutable char pointer
Product: D
Version: D2
Hardware: x86
OS: Windows
Status: NEW
Severity: regression
Priority: P1
Component: Phobos
Assignee: nobody at puremagic.com
Reporter: bearophile_hugs at eml.cc
This seems a regression:
void main() {
import std.conv: to;
immutable(char)* ptr = "hello".ptr;
auto result = ptr.to!(char[]);
}
...\dmd2\src\phobos\std\conv.d(871,16): Error: cannot implicitly convert
expression (value ? dup(value[0..strlen(value)]) : null) of type const(char)[]
to char[]
...\dmd2\src\phobos\std\conv.d(287,24): Error: template instance
std.conv.toImpl!(char[], immutable(char)*) error instantiating
test.d(4,22): instantiated from here: to!(immutable(char)*)
--
More information about the Digitalmars-d-bugs
mailing list