Re: TIL: writing to a socket and dying

2025-04-25 Thread Andy Valencia via Digitalmars-d-learn
On Thursday, 24 April 2025 at 19:36:03 UTC, kdevel wrote: Phobos appears to try and inhibit this on some BSD systems, How does it do that? Sorry, I forgot to answer this question. There's a setsockopt SO_NOSIGPIPE which is used if available during initial socket setup (in Phobos). Some com

Re: Create module-level function using mixin template?

2025-04-25 Thread monkyyy via Digitalmars-d-learn
On Friday, 25 April 2025 at 16:14:49 UTC, Andy Valencia wrote: I have a code pattern, and would like to generate rather than copy/paste. It _seems_ like mixin templates apply, but I'm not having much luck. I saw one comment that templates always expand in their own context, so perhaps they're

Re: extern(C++): override nonvirtual member function

2025-04-25 Thread evilrat via Digitalmars-d-learn
On Friday, 25 April 2025 at 16:59:10 UTC, sfp wrote: On Friday, 25 April 2025 at 05:24:55 UTC, evilrat wrote: both f() would be marked `final` in D which will tell it is 'nonvirtual override', and then you will have more headache. I don't care if I have a headache or not, I need to wrap the C

Re: extern(C++): override nonvirtual member function

2025-04-25 Thread sfp via Digitalmars-d-learn
On Friday, 25 April 2025 at 18:01:25 UTC, evilrat wrote: On Friday, 25 April 2025 at 16:59:10 UTC, sfp wrote: [...] but you already having it :) [...] Well then, time to resolve to some craftery. [...] I'll see how this goes... Looks promising. Thanks for the aspirin. :-)

Re: Create module-level function using mixin template?

2025-04-25 Thread Andy Valencia via Digitalmars-d-learn
On Friday, 25 April 2025 at 16:59:16 UTC, monkyyy wrote: its extremely unclear what your trying to do my best geuss: I want to use a mixin template to generate a top-level function. Like, is there a variant of the following which makes a function named "foo1" available? Andy ```d mixin te

Re: Create module-level function using mixin template?

2025-04-25 Thread H. S. Teoh via Digitalmars-d-learn
On Fri, Apr 25, 2025 at 05:24:18PM +, Andy Valencia via Digitalmars-d-learn wrote: > On Friday, 25 April 2025 at 16:59:16 UTC, monkyyy wrote: > > its extremely unclear what your trying to do my best geuss: > > I want to use a mixin template to generate a top-level function. Your best bet act

Re: Create module-level function using mixin template?

2025-04-25 Thread Ali Çehreli via Digitalmars-d-learn
On 4/25/25 10:24 AM, Andy Valencia wrote: On Friday, 25 April 2025 at 16:59:16 UTC, monkyyy wrote: its extremely unclear what your trying to do my best geuss: I want to use a mixin template to generate a top-level function. Like, is there a variant of the following which makes a function name

Re: Debugging on Windows

2025-04-25 Thread Imperatorn via Digitalmars-d-learn
On Wednesday, 16 April 2025 at 20:08:00 UTC, Arokh Slade wrote: Hello, I'm trying to get debugging on windows 10 to work. d_test.d ```D void main() { int i; } ``` I compile with: dmd -g -gf -m64 .\d_test.d I load the msvc debugger with devenv /DebugExe .\d_test.exe latest visualD insta

Create module-level function using mixin template?

2025-04-25 Thread Andy Valencia via Digitalmars-d-learn
I have a code pattern, and would like to generate rather than copy/paste. It _seems_ like mixin templates apply, but I'm not having much luck. I saw one comment that templates always expand in their own context, so perhaps they're not useful for generating a top-level function? Andy ```d b

Re: extern(C++): override nonvirtual member function

2025-04-25 Thread sfp via Digitalmars-d-learn
On Friday, 25 April 2025 at 05:24:55 UTC, evilrat wrote: both f() would be marked `final` in D which will tell it is 'nonvirtual override', and then you will have more headache. I don't care if I have a headache or not, I need to wrap the C++ code and I can't change it. Needs must. I tried t

Re: Create module-level function using mixin template?

2025-04-25 Thread monkyyy via Digitalmars-d-learn
On Friday, 25 April 2025 at 17:24:18 UTC, Andy Valencia wrote: On Friday, 25 April 2025 at 16:59:16 UTC, monkyyy wrote: its extremely unclear what your trying to do my best geuss: I want to use a mixin template to generate a top-level function. Like, is there a variant of the following which