Honestly, from what I understand of how this works, what I find
weird is the struct case. immutable on classes does _not_ make
the class itself immutable. It just makes all of its members
immutable - hence the error about trying to allocate new Foo
instead of new immutable Foo. So, that is exac
On Tuesday, 12 June 2018 at 15:35:42 UTC, Steven Schveighoffer
wrote:
No, that's not what I mean. What I mean is:
int[] arr = [1,2,3].s;
int[] arr2 = [4,5,6].s;
Legally, the compiler is allowed to reuse the stack memory
allocated for arr for arr2. The lifetime of the arr data is
over.
-Ste
I have a simple tree C data-structure that looks like this:
node {
node parent:
vector[node] children;
}
I would like to create two foreach algorthims, one follwing the breadth
first search pattern and one the depth first search pattern.
Is this possible? I read about Inputran
On 14/06/2018 11:31 PM, Robert M. Münch wrote:
I have a simple tree C data-structure that looks like this:
node {
struct Node {
node parent:
Node* parent;
vector[node] children;
Node[] children;
}
I would like to create two foreach algorthims, one follwing the breadth
fir
On Thursday, 14 June 2018 at 11:31:50 UTC, Robert M. Münch wrote:
Is this possible? I read about Inputranges, took a look at the
RBTree code etc. but don't relly know/understand where to start.
You can also use opApply to iterate over a tree using foreach,
see:
https://tour.dlang.org/tour/en/
On 2018-06-14 11:46:04 +, Dennis said:
On Thursday, 14 June 2018 at 11:31:50 UTC, Robert M. Münch wrote:
Is this possible? I read about Inputranges, took a look at the RBTree
code etc. but don't relly know/understand where to start.
You can also use opApply to iterate over a tree using fo
On 6/14/18 7:07 AM, Guillaume Piolat wrote:
On Tuesday, 12 June 2018 at 15:35:42 UTC, Steven Schveighoffer wrote:
No, that's not what I mean. What I mean is:
int[] arr = [1,2,3].s;
int[] arr2 = [4,5,6].s;
Legally, the compiler is allowed to reuse the stack memory allocated
for arr for arr2.
On 6/14/18 8:35 AM, Robert M. Münch wrote:
On 2018-06-14 11:46:04 +, Dennis said:
On Thursday, 14 June 2018 at 11:31:50 UTC, Robert M. Münch wrote:
Is this possible? I read about Inputranges, took a look at the RBTree
code etc. but don't relly know/understand where to start.
You can also
On Thursday, 14 June 2018 at 11:31:50 UTC, Robert M. Münch wrote:
I have a simple tree C data-structure that looks like this:
node {
node parent:
vector[node] children;
}
I would like to create two foreach algorthims, one follwing the
breadth first search pattern and one the de
On Thursday, June 14, 2018 08:39:48 RazvanN via Digitalmars-d-learn wrote:
> > Honestly, from what I understand of how this works, what I find
> > weird is the struct case. immutable on classes does _not_ make
> > the class itself immutable. It just makes all of its members
> > immutable - hence th
On Thursday, June 14, 2018 08:40:10 Steven Schveighoffer via Digitalmars-d-
learn wrote:
> On 6/14/18 7:07 AM, Guillaume Piolat wrote:
> > On Tuesday, 12 June 2018 at 15:35:42 UTC, Steven Schveighoffer wrote:
> >> No, that's not what I mean. What I mean is:
> >>
> >> int[] arr = [1,2,3].s;
> >> int
On Wednesday, 13 June 2018 at 20:08:06 UTC, Jonathan M Davis
wrote:
On Wednesday, June 13, 2018 10:56:41 wjoe via
Digitalmars-d-learn wrote:
On Wednesday, 13 June 2018 at 03:14:33 UTC, Jonathan M Davis
> regardless of whether the decision to treat failed memory
> allocations as an Error was a g
On Thursday, June 14, 2018 18:11:20 wjoe via Digitalmars-d-learn wrote:
> On Wednesday, 13 June 2018 at 20:08:06 UTC, Jonathan M Davis
> wrote:
> > On Wednesday, June 13, 2018 10:56:41 wjoe via
> > The idea is that because your program is in an invalid state,
> > attempting a graceful shutdown is u
Hello,
I wanted to know if such code was possible :
alias Operation = Algebraic!(/* All type that implements X UDA */)
struct X
{
int opcode;
Operation h;
}
@X(0x01, Hello(3))
@X(0x02, Hello(4))
struct Hello
{
int Hello;
}
@X(0x03, Toto(5))
@X(0x05, Toto(6))
struct Toto
{
int A
On Thursday, 14 June 2018 at 19:06:07 UTC, Jonathan M Davis wrote:
As I said, personally, I think that the program shut just print
and terminate rather than throwing an Error. Walter seems to
It makes perfectly sense for it to throw an error and not just
print and terminate.
This is especial
On Wednesday, 13 June 2018 at 07:35:25 UTC, RazvanN wrote:
Hello,
I'm having a hard time understanding whether this inconsistency
is a bug or intended behavior:
immutable class Foo {}
immutable struct Bar {}
void main()
{
import std.stdio : writeln;
Foo a;
Bar b;
writeln("ty
16 matches
Mail list logo