On Thursday, 15 March 2018 at 19:36:10 UTC, jmh530 wrote:
I recall some talk Andrei did where he said it was a bad idea
to make the allocator part of the type. However, the container
library in dlang-community(says it is backed with
std.experimental.allocator) contains allocator as part of the
On 3/15/18 6:30 PM, jmh530 wrote:
On Thursday, 15 March 2018 at 21:43:41 UTC, Steven Schveighoffer wrote:
[snip]
I don't know if I've heard Andrei talk about that, but I definitely
have made it part of the type for types that need to allocate. The
only other possibility is to accept and use an
On Thursday, 15 March 2018 at 23:15:47 UTC, Cecil Ward wrote:
On Thursday, 15 March 2018 at 23:14:14 UTC, Cecil Ward wrote:
On Tuesday, 2 January 2018 at 18:21:13 UTC, Tim Hsu wrote:
[...]
U
or even 'I' will be delighted to take a look.
Also link time optimisation and whole program optimi
On Thursday, 15 March 2018 at 23:14:14 UTC, Cecil Ward wrote:
On Tuesday, 2 January 2018 at 18:21:13 UTC, Tim Hsu wrote:
[...]
U
or even 'I' will be delighted to take a look.
On Tuesday, 2 January 2018 at 18:21:13 UTC, Tim Hsu wrote:
I am creating Vector3 structure. I use struct to avoid GC.
However, struct will be copied when passed as parameter to
function
struct Ray {
Vector3f origin;
Vector3f dir;
@nogc @system
this(Vector3f *origin, Vector3f
Miguel L wrote:
as the calculations on f guarantee it cannot be 0 at all.
than `f` will become zero very soon. something that "cannot happen" is the
most probable thing to happen.
otherwise, LGTM.
On 03/15/2018 03:16 AM, Andrey wrote:
Hello, is there way to declare read only field for class type with
ability to call inner non constant methods? i.e.:
class A {
int value = 12;
void updateValue() {
value = 13;
}
}
class B {
const A a;
this() {
a = new
On Thursday, 15 March 2018 at 21:43:41 UTC, Steven Schveighoffer
wrote:
[snip]
I don't know if I've heard Andrei talk about that, but I
definitely have made it part of the type for types that need to
allocate. The only other possibility is to accept and use an
Allocator object (i.e. the interf
On Wednesday, 14 March 2018 at 22:23:47 UTC, Cecil Ward wrote:
say in C I have a function with a pointer argument
foo( const sometype_t * p )
[...]
That's the secret - I didn't know about the const (T) * thing - I
would never have discovered that ! Many thanks, the missing piece
to the
On 3/15/18 3:36 PM, jmh530 wrote:
I recall some talk Andrei did where he said it was a bad idea to make
the allocator part of the type. However, the container library in
dlang-community(says it is backed with std.experimental.allocator)
contains allocator as part of the type. Automem does too.
On Thursday, 15 March 2018 at 15:41:54 UTC, Robert-D wrote:
Why something like this doesn't compile (with or without the
cast on bb.dup)?
struct S {
string[string] aa;
S dup() inout pure {
return S(cast(string[string]) aa.dup);
}
}
struct SS {
S[] bb;
SS dup() ino
I recall some talk Andrei did where he said it was a bad idea to
make the allocator part of the type. However, the container
library in dlang-community(says it is backed with
std.experimental.allocator) contains allocator as part of the
type. Automem does too. Honestly, I would think you would
On Thursday, 15 March 2018 at 00:06:49 UTC, Cecil Ward wrote:
Can anyone point me in the direction of a library that provides
very very lightweight (minimum overhead) asynchronous i/o
routines for - shopping list
1. sending and receiving IPv4 / IPv6 packets,
2. sending receiving ICMP and
3, ha
On Thursday, 15 March 2018 at 15:48:52 UTC, James Blachly wrote:
On Wednesday, 14 March 2018 at 22:58:25 UTC, ag0aep6g wrote:
You can probably get around the (manually maintained?)
`FIELDS` array with `.tupleof` or something similar:
static foreach (i, f; S.tupleof)
{
case __traits(id
On 3/15/2018 12:39 PM, Miguel L wrote:
On Thursday, 15 March 2018 at 17:31:38 UTC, rumbu wrote:
On Thursday, 15 March 2018 at 17:18:08 UTC, Miguel L wrote:
On Thursday, 15 March 2018 at 16:31:56 UTC, Stefan Koch wrote:
On Thursday, 15 March 2018 at 15:28:16 UTC, Miguel L wrote:
[...]
intege
On Thursday, 15 March 2018 at 17:31:38 UTC, rumbu wrote:
On Thursday, 15 March 2018 at 17:18:08 UTC, Miguel L wrote:
On Thursday, 15 March 2018 at 16:31:56 UTC, Stefan Koch wrote:
On Thursday, 15 March 2018 at 15:28:16 UTC, Miguel L wrote:
[...]
integers don't have a sign-bit.
since they are
On Thursday, 15 March 2018 at 17:18:08 UTC, Miguel L wrote:
On Thursday, 15 March 2018 at 16:31:56 UTC, Stefan Koch wrote:
On Thursday, 15 March 2018 at 15:28:16 UTC, Miguel L wrote:
Why does std.math.signbit only work for floating point types?
Is there an analogue function for integer types? w
On Thursday, 15 March 2018 at 16:31:56 UTC, Stefan Koch wrote:
On Thursday, 15 March 2018 at 15:28:16 UTC, Miguel L wrote:
Why does std.math.signbit only work for floating point types?
Is there an analogue function for integer types? what is the
best way to compare the sign of a float with the
On Thursday, 15 March 2018 at 16:31:56 UTC, Stefan Koch wrote:
On Thursday, 15 March 2018 at 15:28:16 UTC, Miguel L wrote:
Why does std.math.signbit only work for floating point types?
Is there an analogue function for integer types? what is the
best way to compare the sign of a float with the
On Thursday, 15 March 2018 at 15:28:16 UTC, Miguel L wrote:
Why does std.math.signbit only work for floating point types?
Is there an analogue function for integer types? what is the
best way to compare the sign of a float with the sign of an
integer?
Thanks in advance
integers don't have a
On Thursday, 15 March 2018 at 15:28:16 UTC, Miguel L wrote:
Why does std.math.signbit only work for floating point types?
Integers are stored in an entirely different way, twos-complement
instead of having a sign bit.
You probably shouldn't be using the sign bit function at all, it
is for d
On Thursday, 15 March 2018 at 15:28:16 UTC, Miguel L wrote:
Why does std.math.signbit only work for floating point types?
Is there an analogue function for integer types?
I guess because for integers you don't need to distinguish
between +0.0 and -0.0, so no one bother until now to add it to
On Wednesday, 14 March 2018 at 22:58:25 UTC, ag0aep6g wrote:
You can probably get around the (manually maintained?) `FIELDS`
array with `.tupleof` or something similar:
static foreach (i, f; S.tupleof)
{
case __traits(identifier, f):
}
Any pointers / design patterns on this parti
On Thursday, 15 March 2018 at 13:18:38 UTC, Simen Kjærås wrote:
On Thursday, 15 March 2018 at 12:00:08 UTC, Robert-D wrote:
I want the function to create a mutable copy from a const or a
imutable
Like this:
void main() {
const S s = S(["": ""]);
S b = s.dup();
}
How can i do that?
Why does std.math.signbit only work for floating point types?
Is there an analogue function for integer types? what is the best
way to compare the sign of a float with the sign of an integer?
Thanks in advance
On Thursday, 15 March 2018 at 13:44:20 UTC, Seb wrote:
On Thursday, 15 March 2018 at 10:57:52 UTC, Mike Parker wrote:
On Thursday, 15 March 2018 at 10:55:16 UTC, Mike Parker wrote:
class A {
private int _value = 12;
int value() @property { return _value; }
void updateValue() { va
On Thursday, 15 March 2018 at 13:44:20 UTC, Seb wrote:
On Thursday, 15 March 2018 at 10:57:52 UTC, Mike Parker wrote:
On Thursday, 15 March 2018 at 10:55:16 UTC, Mike Parker wrote:
[...]
Sorry. I overlooked that B.a is const.
It still works, the `value` just needs to be `const` (or
`inout
On Thursday, 15 March 2018 at 10:57:52 UTC, Mike Parker wrote:
On Thursday, 15 March 2018 at 10:55:16 UTC, Mike Parker wrote:
class A {
private int _value = 12;
int value() @property { return _value; }
void updateValue() { value = 13; }
}
...
auto a = new A();
writeln(a.value);
a
On Thursday, 15 March 2018 at 12:00:08 UTC, Robert-D wrote:
I want the function to create a mutable copy from a const or a
imutable
Like this:
void main() {
const S s = S(["": ""]);
S b = s.dup();
}
How can i do that?
In that case, the problem is that you also have to .dup the aa:
On Thursday, 15 March 2018 at 11:33:49 UTC, Simen Kjærås wrote:
On Thursday, 15 March 2018 at 11:18:48 UTC, Robert-D wrote:
[...]
This is where things go wrong:
[...]
'inout' means that this function can keep the const, immutable
or mutable status of the type on which the function is
On Thursday, 15 March 2018 at 11:18:48 UTC, Robert-D wrote:
struct S {
string[string] aa;
S dup() inout pure {
return S(aa);
}
}
void main() {
auto s = S(["": ""]);
s.dup();
}
Result:
Error: cannot implicitly convert expression this.aa of type
inout(string[string]
struct S {
string[string] aa;
S dup() inout pure {
return S(aa);
}
}
void main() {
auto s = S(["": ""]);
s.dup();
}
Result:
Error: cannot implicitly convert expression this.aa of type
inout(string[string]) to string[string]
I need help with the above program.
On Thursday, 15 March 2018 at 10:16:49 UTC, Andrey wrote:
Hello, is there way to declare read only field for class type
with ability to call inner non constant methods? i.e.:
class A {
int value = 12;
void updateValue() {
value = 13;
}
}
class B {
const A a;
this(
On Thursday, 15 March 2018 at 10:16:49 UTC, Andrey wrote:
Hello, is there way to declare read only field for class type
with ability to call inner non constant methods? i.e.:
class A {
int value = 12;
void updateValue() {
value = 13;
}
}
class B {
const A a;
this(
On Thursday, 15 March 2018 at 10:55:16 UTC, Mike Parker wrote:
class A {
private int _value = 12;
int value() @property { return _value; }
void updateValue() { value = 13; }
}
...
auto a = new A();
writeln(a.value);
a.updateValue();
writeln(a.value);
Sorry. I overlooked that B.a
On Tuesday, 13 March 2018 at 22:56:31 UTC, Jonathan M Davis wrote:
The downside is that it increases the number of symbols which
the program has to deal with when linking against a shared
library, which can have some negative effects.
- Jonathan M Davis
If I understand correctly it's also re
Hello, is there way to declare read only field for class type
with ability to call inner non constant methods? i.e.:
class A {
int value = 12;
void updateValue() {
value = 13;
}
}
class B {
const A a;
this() {
a = new A();
a.updateValue(); // error
37 matches
Mail list logo