On Wednesday, 11 November 2020 at 22:29:00 UTC, SealabJaster
wrote:
On Wednesday, 11 November 2020 at 22:10:38 UTC, WhatMeWorry
wrote:
Thanks. Would you or anyone reading this know if this is
unique to D or does C++ also behave like this? Also, where is
the memory, that new allocates? Is it i
On Wednesday, 11 November 2020 at 22:10:38 UTC, WhatMeWorry wrote:
Thanks. Would you or anyone reading this know if this is
unique to D or does C++ also behave like this? Also, where is
the memory, that new allocates? Is it in the heap (thought heap
was available only at runtime) or some othe
On Wednesday, 11 November 2020 at 22:10:38 UTC, WhatMeWorry wrote:
Also, where is the memory, that new allocates?
It is in the executable's static data block, just like if you
declared a static array in the global space.
I think this is D specific but I'm not sure about that.
On Wednesday, 11 November 2020 at 06:21:38 UTC, Jacob Carlborg
wrote:
On 2020-11-11 06:29, WhatMeWorry wrote:
Which begs the question, how would the statement, m_State =
new BreakState() ever get executed?
class DebuggerSession
{
private BreakState m_State = new BreakState();
privat
On Wednesday, 11 November 2020 at 13:30:16 UTC, Simen Kjærås
wrote:
The short answer is 'because that's how we've chosen to define
it'. A more involved answer is that changing every reference is
prohibitively expensive - it would require the equivalent of a
GC collection on every reallocation,
Alright, thanks for sharing this thoughts and arguments!
Or similar problem:
class Foo{}
struct Slice{
Foo[] data;
this(return scope Foo[] data)@safe {
this.data = data;
}
Slice opSlice()@safe return scope{
return Slice(data);
}
Foo opIndex(size_t i)@safe return scope{
return data[i];
}
}
void main
Hello,
Why does expression 'foo = bars[][0].foo' work but 'foo =
bars[].front.foo' doesn't?
example:
class Foo{}
struct Bar{
Foo foo;
}
void main()@safe{
import std;
Foo foo;
scope Bar[] bars = [Bar.init];
foo = bars[][0].foo;//OK, WHY?
foo
On Wednesday, 11 November 2020 at 08:13:23 UTC, Namal wrote:
Hello,
I want to do a small project but I need a text replacement
tool/lib like Apache's FreeMarker. Is there something similar
for D?
Thx
Maybe not so powerful but useful: mustache-d
On Wednesday, 11 November 2020 at 10:17:09 UTC, zack wrote:
I am new to D. Appending to an array can lead to reallocation,
that's clear. But why is the "reference" b not changed
accordingly to the new position and still points to "old"
memory? Why is b not also changed when reallocating array a
On Tuesday, 10 November 2020 at 01:00:50 UTC, Mark wrote:
I haven't looked into the newest C++. In theory, they might
have added something helpful in the past years.
I guess you could say that the latest version of C++ allows you
to write code that is a little bit less verbose than before. C++
On Wednesday, 11 November 2020 at 10:17:09 UTC, zack wrote:
I am new to D. Appending to an array can lead to reallocation,
that's clear. But why is the "reference" b not changed
accordingly to the new position and still points to "old"
memory? Why is b not also changed when reallocating array a
On Tuesday, 10 November 2020 at 20:13:30 UTC, Daniel Kozak wrote:
non static nested function is a delegate, so you can just
assign it to delegate like I have posted or you can du this:
import std.stdio;
void main() {
void foo() {
writeln("It works as expected");
}
enum pf
I am new to D. Appending to an array can lead to reallocation,
that's clear. But why is the "reference" b not changed
accordingly to the new position and still points to "old" memory?
Why is b not also changed when reallocating array a and the old
data getting invalid/freed?
auto a = [55,10,2
Hello,
I want to do a small project but I need a text replacement
tool/lib like Apache's FreeMarker. Is there something similar for
D?
Thx
15 matches
Mail list logo