On Friday, 14 January 2022 at 17:56:48 UTC, Adam D Ruppe wrote:
On Friday, 14 January 2022 at 17:48:41 UTC, kyle wrote:
[...]
alias works in term of compile-time names, not values. This
means the `this` value, being run time, gets discarded.
[...]
Thanks Adam. We need a repository of arti
I'm trying to use ```alias``` in an operator overload to reduce
typing, but what gets aliased is not what I expect. Tested in DMD
v2.098.1-dirty on Windows plus whatever versions of DMD, GDC, and
LDC I have installed on Linux. Thanks.
```
struct Broke
{
double num;
import std.traits :
On Friday, 29 October 2021 at 18:19:58 UTC, Salih Dincer wrote:
On Thursday, 28 October 2021 at 21:23:15 UTC, kyle wrote:
```
void main()
{
import std.math : abs, sgn;
alias n_type = short; //or int, long, byte, whatever
assert(n_type.min == abs(n_type.min));
assert(sgn(abs(n_t
On Thursday, 28 October 2021 at 21:23:15 UTC, kyle wrote:
```
void main()
{
import std.math : abs, sgn;
alias n_type = short; //or int, long, byte, whatever
assert(n_type.min == abs(n_type.min));
assert(sgn(abs(n_type.min)) == -1);
}
```
I stumbled into this fun today. I underst
```
void main()
{
import std.math : abs, sgn;
alias n_type = short; //or int, long, byte, whatever
assert(n_type.min == abs(n_type.min));
assert(sgn(abs(n_type.min)) == -1);
}
```
I stumbled into this fun today. I understand why abs yields a
negative value here with overflow and
On Monday, 27 September 2021 at 16:23:49 UTC, Adam D Ruppe wrote:
On Monday, 27 September 2021 at 16:20:59 UTC, Steven
Schveighoffer wrote:
That's a regression. In 2.092.1, it reports:
aye known bug here
https://issues.dlang.org/show_bug.cgi?id=21321
maybe once dmd can compile C code we'll f
I'm attempting Markdown for the first time so forgive me if that
doesn't go well. Consider the following:
```d
interface A
{
bool broken();
}
abstract class B : A
{
}
class C : B
{
}
void main()
{
import std.stdio;
C test = new C();
writeln(test);
}
```
DMD compiles this p
On Sunday, 16 May 2021 at 18:30:49 UTC, Alain De Vos wrote:
Is there a list of compiler flags not shown ?
ldc2 -help-hidden
I've been doing some review of Andrei's book which has led me to
trying to figure out how placement new works, or doesn't work.
The new(address) Type syntax tells me "no allocator for TYPE". I
did find information on "Class Allocators" at
https://dlang.org/spec/class.html#allocators, but when I
On Thursday, 15 February 2018 at 18:30:57 UTC, Jonathan M Davis
wrote:
On Thursday, February 15, 2018 17:53:54 Kyle via
Digitalmars-d-learn wrote:
I want to be able to pass an int to a function, then in the
function ensure that the int is little-endian (whether it
starts out that way or needs
"What I'm trying to achieve is to ensure that an int is in
little-endiannes"
Ignore that last part, whoops.
On Thursday, 15 February 2018 at 17:43:10 UTC, Jonathan M Davis
wrote:
On Thursday, February 15, 2018 16:51:05 Kyle via
Digitalmars-d-learn wrote:
Hi. Is there a convenient way to convert a ubyte[4] into a
signed int? I'm having trouble handling the static arrays
return
On Thursday, 15 February 2018 at 17:25:15 UTC, ketmar wrote:
Nicholas Wilson wrote:
On Thursday, 15 February 2018 at 16:51:05 UTC, Kyle wrote:
Hi. Is there a convenient way to convert a ubyte[4] into a
signed int? I'm having trouble handling the static arrays
returned by std.bitmanip.nativeTo
Hi. Is there a convenient way to convert a ubyte[4] into a signed
int? I'm having trouble handling the static arrays returned by
std.bitmanip.nativeToLittleEndian. Is there some magic sauce to
make the static arrays into input ranges or something? As a side
note, I'm used to using D on Linux an
On Sunday, 29 November 2015 at 01:57:25 UTC, Adam D. Ruppe wrote:
..
Are you compiling it as a 64 bit or a 32 bit program?
64 bit. You're probably right, I will take out the explicit
destroy and look for a memory leak elsewhere, and adjust for your
other suggestions. Thanks for the advice!
Hi,
I have a function using the derelict-enet library:
void sendUbytes(ENetPeer* dest, ref ubyte[] data)
{
//create packet
ENetPacket* packet = enet_packet_create(cast(ubyte*)data,
data.length * ubyte.sizeof, ENET_PACKET_FLAG_RELIABLE);
//send packet to peer over channel id 0
Thanks! I'll try this out after I get home.
I have a variable, x, which I want to update when the content of
a DlangUI EditLine is modified. I tried making this work with the
"onContentChange" method listed in the API documentation, but dmd
told me it's not there. I've got this working now by implementing
a custom subclass of EditLine as
If you memoize a method inside a class definition using
std.functional.memoize is caching done in a per-object manner, or
do all objects of this class share cached return values? Thank
you.
Hi,
Has anyone successfully used D to capture images from a webcam?
Something like what you can do with OpenCV or pygame's camera
API? Any idea how I can do this without having to know a lot of
complex stuff? Thanks!
20 matches
Mail list logo