On Wed, Nov 02, 2022 at 09:16:22PM +0100, Christian Köstlin via
Digitalmars-d-learn wrote:
> On 02.11.22 20:16, H. S. Teoh wrote:
[...]
> > IMO, the ideal situation is a hybrid situation: the underlying build
> > mechanism should be purely declarative, because otherwise the
> > complexity just
On 11/3/22 1:46 PM, Tejas wrote:
Check my post, `A& a;` refuses to compile in C++20 atleast, asking to be
explicitly initialized, thus averting the problem altogether
That's different, `A&` cannot be rebound in C++, whereas a class
reference can.
Try `A* a;` and see if it compiles
-Steve
On Tuesday, 1 November 2022 at 16:17:08 UTC, Hipreme wrote:
The linker used on Windows when installing DMD is pretty much
decided on how your PC was setup.
[...]
Do you have a blog?
On Thursday, 3 November 2022 at 10:26:04 UTC, Imperatorn wrote:
On Thursday, 3 November 2022 at 10:00:27 UTC, Bruno Pagis wrote:
Good morning,
I have the following class:
```
class A {
int[] array;
...
void print() {
writeln("array = ", this.array);
}
}
```
I would like to unit
On Thursday, 3 November 2022 at 15:40:02 UTC, H. S. Teoh wrote:
On Thu, Nov 03, 2022 at 04:41:14AM +, Siarhei Siamashka via
Digitalmars-d-learn wrote: [...]
```D
@safe:
import std.stdio;
class A {
void foo() { writeln("foo"); }
}
void main() {
auto a1 = new A;
a1.foo(); // prints
On Thursday, 3 November 2022 at 10:00:27 UTC, Bruno Pagis wrote:
Good morning,
I would like to unit test the print function (yes, I know, not
very useful on the above example since print is merely a
duplicate of writeln...). Is there a way to use assert to test
the output of the print
On Thu, Nov 03, 2022 at 08:51:52AM -0700, Ali Çehreli via Digitalmars-d-learn
wrote:
> On 11/3/22 03:00, Bruno Pagis wrote:
>
> >void print() {
> > writeln("array = ", this.array);
> >}
>
> Similar to Paul Backus's program but I would try to avoid the file system
> for unit tests
On 11/3/22 08:40, H. S. Teoh wrote:
> D does not have the equivalent of C++'s allocating a class instance on
> the stack.
Not by default but we have two different ways, either may be discouraged:
import std.typecons : scoped;
import std.stdio;
class C {
int i;
}
void main() {
//
On Thursday, 3 November 2022 at 15:40:02 UTC, H. S. Teoh wrote:
D does not have the equivalent of C++'s allocating a class
instance on the stack. In D, all class instances are allocated
on the heap and class variables are references to them.
well there is
scope Object o = new Object;
which
On 11/3/22 03:00, Bruno Pagis wrote:
>void print() {
> writeln("array = ", this.array);
>}
Similar to Paul Backus's program but I would try to avoid the file
system for unit tests when possible. In this case, you can print into a
sink, which can be useful in other ways as well:
On Thu, Nov 03, 2022 at 04:41:14AM +, Siarhei Siamashka via
Digitalmars-d-learn wrote:
[...]
> ```D
> @safe:
> import std.stdio;
> class A {
> void foo() { writeln("foo"); }
> }
> void main() {
> auto a1 = new A;
> a1.foo(); // prints "foo"
> A a2;
> a2.foo(); // Segmentation fault
On 11/3/22 04:58, Paul Backus wrote:
> https://issues.dlang.org/show_bug.cgi?id=23453
Even though iterating over UTF value ranges don't make sense in general,
they would work for some values including the ASCII range.
Ali
On Thursday, 3 November 2022 at 04:41:14 UTC, Siarhei Siamashka
wrote:
C++ code:
```C++
#include
class A {
public:
void foo() { std::cout << "foo" << std::endl; }
};
int main() {
auto a1 = new A;
a1->foo(); // prints "foo"
A a2;
a2.foo(); // prints "foo"
delete a1;
}
```
D code:
On Thursday, 3 November 2022 at 06:26:22 UTC, Salih Dincer wrote:
Hi All,
Isn't there a save feature for `iota()`?
Looking at the source, it seems that only the numeric overloads
of `iota` implement `save`. I think this is probably just an
oversight, though, since I can't see any reason why
On Thursday, 3 November 2022 at 10:00:27 UTC, Bruno Pagis wrote:
Good morning,
I have the following class:
```
class A {
int[] array;
...
void print() {
writeln("array = ", this.array);
}
}
```
I would like to unit test the print function (yes, I know, not
very useful on the
On Thursday, 3 November 2022 at 10:00:27 UTC, Bruno Pagis wrote:
Good morning,
I have the following class:
```
class A {
int[] array;
...
void print() {
writeln("array = ", this.array);
}
}
```
I would like to unit test the print function (yes, I know, not
very useful on the
You could redirect stdout to a file of your choosing and test against that.
Although ideally you would instead take as an argument to print some
sort of output range or Appender. Then you could test against that instead.
Good morning,
I have the following class:
```
class A {
int[] array;
...
void print() {
writeln("array = ", this.array);
}
}
```
I would like to unit test the print function (yes, I know, not
very useful on the above example since print is merely a
duplicate of writeln...). Is
On Friday, 21 October 2022 at 12:05:28 UTC, ryuukk_ wrote:
On Thursday, 20 October 2022 at 14:03:10 UTC, tchaloupka wrote:
void test(Foo..)(Foo foos)
I don't know if that's the 1:1 alternative, but that doesn't
compile
onlineapp.d(23): Error: struct `onlineapp.Foo` is not
copyable
Hi All,
Isn't there a save feature for `iota()`?
```d
import std.stdio;
import std.range;
void main()
{
foreach(num; iota!char('a', 'f').chunks(3)/*
"onetwosixfour".chunks(3)//*/
) {
//auto n = num.save();
num.writeln(": ", num.walkLength);
}
On Thursday, 3 November 2022 at 06:02:13 UTC, Mike Parker wrote:
are in C++. D enforces the distinction that C++
...that C++ programmers often follow by convention.
On Thursday, 3 November 2022 at 05:41:06 UTC, Siarhei Siamashka
wrote:
Thanks for the link and also thanks for confirming that you
have no clue what's going on. I think that what actually
That's not necessary. He does know what's going on and pointed
you to the correct place. The second
22 matches
Mail list logo