On 2/1/21 11:31 AM, Per Nordlöw wrote:
On Monday, 1 February 2021 at 16:30:31 UTC, Per Nordlöw wrote:
Btw, does
x ~ y ~ z ~ ...
result in a single allocation?
Provided all the operands has a `length` property.
As long as they are all arrays, yes, the compiler calls a single runtime
ca
On Monday, 1 February 2021 at 15:47:33 UTC, Steven Schveighoffer
wrote:
"Concatenation always creates a copy of its operands, even if
one of the operands is a 0 length array"
Btw, does
x ~ y ~ z ~ ...
result in a single allocation?
On Monday, 1 February 2021 at 16:30:31 UTC, Per Nordlöw wrote:
Btw, does
x ~ y ~ z ~ ...
result in a single allocation?
Provided all the operands has a `length` property.
On 2/1/21 7:17 AM, ag0aep6g wrote:
On 31.01.21 22:48, Per Nordlöw wrote:
Why isn't
"Name " ~ name ~ " could not be found"
implicitly convertible to `string`?
If concatenation is guaranteed to allocate a new array, then it should
be "strongly pure", and the conversion should work. I'm n
On 1/31/21 4:48 PM, Per Nordlöw wrote:
Why isn't
"Name " ~ name ~ " could not be found"
implicitly convertible to `string`?
One of my oldest Enhancement requests:
https://issues.dlang.org/show_bug.cgi?id=1654
-Steve
On 31.01.21 22:48, Per Nordlöw wrote:
Why isn't
"Name " ~ name ~ " could not be found"
implicitly convertible to `string`?
If concatenation is guaranteed to allocate a new array, then it should
be "strongly pure", and the conversion should work. I'm not sure if it
is guaranteed to allo
On Monday, 1 February 2021 at 10:27:29 UTC, Jacob Carlborg wrote:
Why isn't
"Name " ~ name ~ " could not be found"
implicitly convertible to `string`?
Because if you have arrays of reference types, it's possible to
change an element of the mutable array, which will affect the
immutable
On Sunday, 31 January 2021 at 21:48:09 UTC, Per Nordlöw wrote:
Given
char x[];
why is
typeof("a" ~ x)
`char[]` when
typeof("a" ~ x.idup)
is
`string`?
My case is
class NameLookupException : Exception
{
this(string name) {
super("Name " ~ name ~ " could not be f
Given
char x[];
why is
typeof("a" ~ x)
`char[]` when
typeof("a" ~ x.idup)
is
`string`?
My case is
class NameLookupException : Exception
{
this(string name) {
super("Name " ~ name ~ " could not be found");
}
this(scope const(char)[] name) {
super