On Wednesday, 28 February 2018 at 18:23:04 UTC, Jiyan wrote:
Hey,
i thought i had understood postblit, but in my Code the
following is happening (simplified):
struct C
{
this(this){/*Do sth*/}
list!C;
void opAssign(const C c)
{
"Postlbit from C called".writeln;
// Do sth
}
}
Sry of
Hey,
i thought i had understood postblit, but in my Code the following
is happening (simplified):
struct C
{
this(this){/*Do sth*/}
list!C;
void opAssign(const C c)
{
"Postlbit from C called".writeln;
// Do sth
}
}
struct list(T)
{
node* head;
node* last;
size_t size;
struct node
{
T val;
On Sunday, 25 February 2018 at 22:20:13 UTC, Steven Schveighoffer
wrote:
On 2/25/18 4:25 PM, Jiyan wrote:
[...]
Looks like this was fixed in 2.064.
What version of the compiler are you using?
-Steve
2.077.0
It is really strange, it works now but there still seems to be
some strangeness
Hi,
is there any document or text describing forward references?
It is kinda strange, i implemented a list structure which is
kinda like this:
struct list(T)
{
private:
struct node
{
T val;
node* next;
node* prev;
}
node* head;
node* last;
size_t size;
.
}
The thing is when i
On Wednesday, 21 February 2018 at 11:12:01 UTC, Jiyan wrote:
Hi :),
What i thought was that when i create a struct dynamically i
can just deconstruct it with __dtor lets say:
struct U {...}
struct S {... private U _member;}
S* p;
p = cast(S*)malloc(S.sizeof);
// just run that if it
Hi :),
What i thought was that when i create a struct dynamically i can
just deconstruct it with __dtor lets say:
struct U {...}
struct S {... private U _member;}
S* p;
p = cast(S*)malloc(S.sizeof);
// just run that if it compiles, for simplicity
// we dont use __traits(compiles, ...)
On Tuesday, 6 February 2018 at 01:23:57 UTC, Stefan Koch wrote:
On Monday, 5 February 2018 at 19:54:09 UTC, Jiyan wrote:
Is there any work for an interactive interpreter for D -maybe
just for ctfe-able expressions?
It shouldnt be too hard to implement it regarding the fact,
that ctfe is kinda
Is there any work for an interactive interpreter for D -maybe
just for ctfe-able expressions?
It shouldnt be too hard to implement it regarding the fact, that
ctfe is kinda doing what
an interpreter should do i guess.
Hello,
I want to convert from ints implicit to a struct type, so for
example:
struct use
{
int x;
int toInt()
{
return x;
}
use fromInt(int v)
{
return use(v);
}
alias toInt this; // implicit
Hello,
is there anyway to do something like this:
mixin template foo( exp)
{
static if(__traits(compiles, exp))exp;
}
Thanks :)
Sry i know i asked it already in IRC:
Are rvalue references already solved with auto ref?
https://p0nce.github.io/d-idioms/#Rvalue-references:-Understanding-auto-ref-and-then-not-using-it
Says rvalues are moved!
The other solution seems not so practical.
Is any solution to them intended, or
On Sunday, 19 November 2017 at 19:42:02 UTC, Jonathan M Davis
wrote:
On Sunday, November 19, 2017 19:25:40 Jiyan via
Digitalmars-d-learn wrote:
[...]
Okay. For starters,
[...]
Ah ok thanks very much, this helped me a lot :)
On Sunday, 19 November 2017 at 19:28:37 UTC, Jonathan M Davis
wrote:
On Sunday, November 19, 2017 19:22:51 Jiyan via
Digitalmars-d-learn wrote:
Hello,
i wanted to ask why this isnt working:
struct Text(T : char)
{
size_t _len;
T* _ptr;
}
Thanks :)
What about it isn't working? I think
With working i mean that
Text X;
Doesnt compile!
Hello,
i wanted to ask why this isnt working:
struct Text(T : char)
{
size_t _len;
T* _ptr;
}
Thanks :)
On Thursday, 5 October 2017 at 12:35:26 UTC, Mike Parker wrote:
On Thursday, 5 October 2017 at 12:25:27 UTC, Mike Parker wrote:
[...]
Right. I had to go back and look at what I wrote in Learning D,
which is the last (and only) time I played around with the
default module behavior. I always
On Thursday, 5 October 2017 at 00:28:32 UTC, Mike Parker wrote:
On Wednesday, 4 October 2017 at 16:31:35 UTC, Jiyan wrote:
[...]
If you have this directory tree:
- mylib
-- pack1
--- a.d
--- b.d
pack2
- c.d
[...]
Thank you, i think i kinda got that :)
But as i see it with
Hey,
as i see it the -Ipath command for dmd just imports the files
within a directory but it doesnt work for sub directories, so i
can write something like:
import subdirectoryFromPath.file;
Also with dub this doesnt seem possible (sourcePaths seems to
work as the -I command).
Is there a
On Friday, 8 September 2017 at 16:10:55 UTC, Biotronic wrote:
On Friday, 8 September 2017 at 12:32:35 UTC, Jiyan wrote:
[...]
It's scoped!T's destructor. If you decide to use that
workaround, you should probably copy scoped!T from std.typecons
and have your own version. It's not safe in all
On Friday, 8 September 2017 at 06:37:54 UTC, Biotronic wrote:
On Thursday, 7 September 2017 at 23:40:11 UTC, Jiyan wrote:
[...]
Sadly, even std.typecons.scoped isn't currently @nogc:
https://issues.dlang.org/show_bug.cgi?id=13972
https://issues.dlang.org/show_bug.cgi?id=17592
[...]
First
Hey,
wanted to know whether it is possible to make anonymous nogc
classes:
interface I
{
public void ap();
}
void exec(I i)
{
i.ap;
}
// now execute, but with something like `scope`
exec( new class I
{
int tr = 43;
override void ap(){tr.writeln;}
});
Thanks
On Friday, 11 August 2017 at 02:25:51 UTC, Mike Parker wrote:
On Thursday, 10 August 2017 at 23:38:42 UTC, Jiyan wrote:
[...]
Sounds like you used the script from the download page that
installs the compiler per user. It's designed to allow you to
have multiple versions installed in your
On Thursday, 10 August 2017 at 22:27:44 UTC, HyperParrow wrote:
On Thursday, 10 August 2017 at 20:48:23 UTC, Jiyan wrote:
Hey,
i get the following errors when i try to use dlangui, by just
importing the package i get a lot of errors which look like:
function std.xml.Item.opEquals does not
Hey,
i get the following errors when i try to use dlangui, by just
importing the package i get a lot of errors which look like:
function std.xml.Item.opEquals does not override any function,
did you mean to override 'object.Object.opEquals'?
What is happening there?
Hey,
wanted to the following simple thing with vectorflow:
I want to develop a simple MLP, which has 2 input neurons and one
output neuron.
The network should simply add the input values together, so [1,2]
predicts [3] i guess.
I started in a newbish way to build the following code:
import
On Sunday, 30 July 2017 at 19:32:48 UTC, Eugene Wissner wrote:
On Sunday, 30 July 2017 at 19:22:07 UTC, Jiyan wrote:
Hey,
just wanted to know whether something like this would be
possible sowmehow:
struct S
{
int m;
int n;
this(this)
{
m = void;
n = n;
}
}
So not the whole struct is moved
Hey,
just wanted to know whether something like this would be possible
sowmehow:
struct S
{
int m;
int n;
this(this)
{
m = void;
n = n;
}
}
So not the whole struct is moved everytime f.e. a function is
called, but only n has to be "filled"
Thank you, one last question:
If i declare the parameter as ref i, then there shouldnt be any
overhead wouldnt it?
Thanks :)
On Wednesday, 12 July 2017 at 11:18:08 UTC, Biotronic wrote:
On Wednesday, 12 July 2017 at 11:00:54 UTC, Jiyan wrote:
[...]
The traditional solution is static opCall:
struct A {
int field;
static A opCall() {
A result;
result.field = getDataFromFile("file.txt");
Hey there:)
i want to know whether the following is somehow possible:
structs dont have default constructors, i know so:
struct A
{
int field;
this(int i){field = getDataFromFile("file.txt");}
}
A instance = A(0);
Here comes my issue:
when A(0) is called I would want here optimal performance,
30 matches
Mail list logo