Re: assert in unittest has access to private member?

2019-06-30 Thread Jonathan M Davis via Digitalmars-d-learn
On Sunday, June 30, 2019 11:24:03 AM MDT Robert M. Münch via Digitalmars-d- learn wrote: > I have a case, with templates, where an assert in a unittest can access > a private memember and I don't know how this can happen. > > Before trying to creat an equivalent case, I want to cross-check, if >

Re: assert in unittest has access to private member?

2019-06-30 Thread XavierAP via Digitalmars-d-learn
On Sunday, 30 June 2019 at 17:24:03 UTC, Robert M. Münch wrote: I have a case, with templates, where an assert in a unittest can access a private memember and I don't know how this can happen. Modules are the units of encapsulation in D:

Re: assert in unittest has access to private member?

2019-06-30 Thread a11e99z via Digitalmars-d-learn
On Sunday, 30 June 2019 at 17:24:03 UTC, Robert M. Münch wrote: I have a case, with templates, where an assert in a unittest can access a private memember and I don't know how this can happen. Before trying to creat an equivalent case, I want to cross-check, if assert has special semantics

assert in unittest has access to private member?

2019-06-30 Thread Robert M. Münch via Digitalmars-d-learn
I have a case, with templates, where an assert in a unittest can access a private memember and I don't know how this can happen. Before trying to creat an equivalent case, I want to cross-check, if assert has special semantics in a unittest so that it can access private memembers? -- Robert

Re: Finding the maxElement of Two-Dimensional Array

2019-06-30 Thread Samir via Digitalmars-d-learn
On Sunday, 30 June 2019 at 15:38:42 UTC, a11e99z wrote: try to take slice from static arrays writeln(ta[1][].maxElement); That does what I am looking for. Thank you for the quick reply!

Re: Finding the maxElement of Two-Dimensional Array

2019-06-30 Thread a11e99z via Digitalmars-d-learn
On Sunday, 30 June 2019 at 15:22:42 UTC, Samir wrote: How come this works: int[4][2] ta = [[2, 1, 4, 3], [3, 10, 2, 5]]; writeln(ta[1].maxElement); // get error on this line try to take slice from static arrays writeln(ta[1][].maxElement); or use dynamic arrays (slices) int[][] ta = [[2, 1,

Finding the maxElement of Two-Dimensional Array

2019-06-30 Thread Samir via Digitalmars-d-learn
How come this works: int[][] ta = [[2, 1, 4, 3], [3, 10, 2, 5]]; writeln(ta[1].maxElement); // 10 but I get an error when specifying the number of elements when declaring the array: int[4][2] ta = [[2, 1, 4, 3], [3, 10, 2, 5]]; writeln(ta[1].maxElement); // get error on this line Error: