When I pass my struct to function something is going wrong. I
don't know how to fix it.
Code:
import std.stdio;
void print(ref Vector v, string s){
writefln("%s==%s%s", &v.x, v.ptr, s);
}
struct Vector {
int x;
int* ptr;
this(this) {
On 6/13/18 10:43 AM, Michał wrote:
When I pass my struct to function something is going wrong. I don't know
how to fix it.
Code:
import std.stdio;
void print(ref Vector v, string s){
writefln("%s==%s %s", &v.x, v.ptr, s);
}
struct Vector {
int x;
int* ptr;
this(th
On Wednesday, 13 June 2018 at 16:40:51 UTC, Steven Schveighoffer
wrote:
On 6/13/18 10:43 AM, Michał wrote:
When I pass my struct to function something is going wrong. I
don't know how to fix it.
Code:
import std.stdio;
void print(ref Vector v, string s){
writefln("%s==%s %s", &v.
On 6/13/18 1:08 PM, Michał wrote:
On Wednesday, 13 June 2018 at 16:40:51 UTC, Steven Schveighoffer wrote:
On 6/13/18 10:43 AM, Michał wrote:
When I pass my struct to function something is going wrong. I don't
know how to fix it.
Code:
import std.stdio;
void print(ref Vector v, string s){
On Wednesday, 13 June 2018 at 17:37:44 UTC, Steven Schveighoffer
wrote:
Hm... the only way to do it in D is to provide a function that
checks whether the small vector optimization is in play, and
return a pointer/slice to itself.
With D it is possible to alias the getter function that
provi