Re: Preffered way of writing variadic templated functions in 2.079

2018-03-08 Thread Jonathan M Davis via Digitalmars-d-learn
On Thursday, March 08, 2018 08:36:09 Nordlöw via Digitalmars-d-learn wrote: > Is using > > https://dlang.org/changelog/2.079.0.html#default_after_variadic > > for instance as > > void show(Args...)(Args args, > string file = __FILE__, > uint line = __LINE__,

Preffered way of writing variadic templated functions in 2.079

2018-03-08 Thread Nordlöw via Digitalmars-d-learn
Is using https://dlang.org/changelog/2.079.0.html#default_after_variadic for instance as void show(Args...)(Args args, string file = __FILE__, uint line = __LINE__, string fun = __FUNCTION__) if (Args.length >= 1) { ... }

Re: Can't "is null" an interface?!?! Incompatible types???

2018-03-08 Thread Jacob Carlborg via Digitalmars-d-learn
On Thursday, 8 March 2018 at 08:04:54 UTC, Nick Sabalausky (Abscissa) wrote: Interesting. I was using vibe.d 'v0.8.3-rc.1' (which doesn't appear to work on run.dlang.io). But it does seem to work for me if I use 'v0.8.3-alpha.1'. I wonder what could have changed to result in this? It's a

Re: Can't "is null" an interface?!?! Incompatible types???

2018-03-08 Thread Nick Sabalausky (Abscissa) via Digitalmars-d-learn
On 03/08/2018 01:13 AM, Nicholas Wilson wrote: That does seem odd. --- /+dub.sdl: dependency "vibe-d" version="~>0.8.3-alpha.1" +/ import vibe.core.net; import std.stdio; TCPConnection mySocket; void main() {     auto b = mySocket is null;     writeln(b); } --- works fine on run.dlang.io

Re: Can't "is null" an interface?!?! Incompatible types???

2018-03-08 Thread Nick Sabalausky (Abscissa) via Digitalmars-d-learn
On 03/08/2018 03:04 AM, Nick Sabalausky (Abscissa) wrote: Interesting. I was using vibe.d 'v0.8.3-rc.1' (which doesn't appear to work on run.dlang.io). But it does seem to work for me if I use 'v0.8.3-alpha.1'. I wonder what could have changed to result in this?

Re: Elegant way to use dynamic bindings

2018-03-08 Thread Dennis via Digitalmars-d-learn
On Friday, 9 February 2018 at 20:19:33 UTC, Dennis wrote: I'd still like to find a nice way to generate the boilerplate code for dynamic loading, if I come up with something I'll post it here. So I ended up using an import library for a while, but I then wanted to get the handle of the DLL,

Re: docs/definition: !object

2018-03-08 Thread Steven Schveighoffer via Digitalmars-d-learn
On 3/8/18 1:00 AM, Nick Sabalausky (Abscissa) wrote: On 03/08/2018 12:05 AM, ketmar wrote: Nick Sabalausky (Abscissa) wrote: I'm having trouble finding the documentation for what exactly the unary "not" operator does when applied to a class/interface object. Does this documentation exist

Re: Generic test bit function (core.bitop)

2018-03-08 Thread Pierre via Digitalmars-d-learn
On Wednesday, 7 March 2018 at 13:26:06 UTC, Alex wrote: From this point of view, size_t is not fixed, but capable to point to any place in memory. Therefore, pointer of any type have by definition exactly the defined size of size_t. Thank you,I thougth that pointer aliasing wasn't allowed.

Re: VsCode tutorial

2018-03-08 Thread bauss via Digitalmars-d-learn
On Wednesday, 7 March 2018 at 21:39:09 UTC, Apocalypto wrote: Are there any tutorials about D in vscode? Which are the minimal plugins to install to have code completion, syntax highlighting and code formatting? Are there any app templates that i can invoke to not start every project from

Re: how do I pass this callback?

2018-03-08 Thread Marc via Digitalmars-d-learn
On Thursday, 8 March 2018 at 17:06:05 UTC, Marc wrote: How do I define the callback so that it can be used in RegisterWaitForSingleObject()? I've tried pass as argument: myFunc myFunc.ptr none worked. Here's my code: [...] Function call: [...] Error: [...] Solved! I shall rather

how do I pass this callback?

2018-03-08 Thread Marc via Digitalmars-d-learn
How do I define the callback so that it can be used in RegisterWaitForSingleObject()? I've tried pass as argument: myFunc myFunc.ptr none worked. Here's my code: extern (C) void OnExited(void* context, BOOLEAN isTimeOut); extern(Windows): BOOL RegisterWaitForSingleObject(

Re: dub / win 64 / unresolved externals from run-time lib?

2018-03-08 Thread kinke via Digitalmars-d-learn
On Thursday, 8 March 2018 at 17:03:18 UTC, Robert M. Münch wrote: Using Dub and pretty simple setup, that links in 3 C/C++ static libraries, I get these linker errors: libyogacore.lib(Yoga.obj) : error LNK2019: unresolved external symbol __imp_fmodf referenced in function "void __cdecl

dub / win 64 / unresolved externals from run-time lib?

2018-03-08 Thread Robert M. Münch via Digitalmars-d-learn
Using Dub and pretty simple setup, that links in 3 C/C++ static libraries, I get these linker errors: libyogacore.lib(Yoga.obj) : error LNK2019: unresolved external symbol __imp_fmodf referenced in function "void __cdecl YGRoundToPixelGrid(struct YGNode * const,float,float,float)"

Re: dub / win 64 / unresolved externals from run-time lib?

2018-03-08 Thread Robert M. Münch via Digitalmars-d-learn
On 2018-03-08 17:24:32 +, kinke said: On Thursday, 8 March 2018 at 17:03:18 UTC, Robert M. Münch wrote: Using Dub and pretty simple setup, that links in 3 C/C++ static libraries, I get these linker errors: libyogacore.lib(Yoga.obj) : error LNK2019: unresolved external symbol __imp_fmodf

Re: extern (c) struct ?

2018-03-08 Thread Robert M. Münch via Digitalmars-d-learn
On 2018-03-08 16:03:57 +, Adam D. Ruppe said: How are you accessing it? If it is by pointer only passing it to methods, you can simply: struct my_cpp_struct; and define functions: extern(C) void foo(my_cpp_struct* arg); Hi, :-/ seems I was a bit confused by all the backs and forth on

Re: docs/definition: !object

2018-03-08 Thread Nick Sabalausky (Abscissa) via Digitalmars-d-learn
On 03/08/2018 05:31 AM, Steven Schveighoffer wrote: On 3/8/18 1:00 AM, Nick Sabalausky (Abscissa) wrote: But are we CERTAIN that's all there is to it? I have a non-reduced situation right now where outputting the address of a class reveals a non-null address, and yet

Re: Generic Property Implementation

2018-03-08 Thread Mike Franklin via Digitalmars-d-learn
On Friday, 9 March 2018 at 01:22:15 UTC, Mike Franklin wrote: I would like to know if this can be improved to support the following: * binary assignment operators (e.g. +=) * unary assignment operators (e.g. ++) * @safe, @nogc, and -betterC compatible * at least as good code generation as

does the shared keyword work with mutable structs?

2018-03-08 Thread WhatMeWorry via Digitalmars-d-learn
I read where shared classes have not been implemented yet. So I'm using just a struct e below: But the output below is showing that sharing is not happening between Struct in main() and the various spawned threads. I'm I doing something wrong? creating queue in EventBuffer constructor

Re: Generic Property Implementation

2018-03-08 Thread Mike Franklin via Digitalmars-d-learn
On Tuesday, 20 February 2018 at 14:34:53 UTC, bauss wrote: Would there be a reason why this wouldn't be a good implementation? If so what and how could it be improved? Are there flaws in an implementation like this? [... snip ...] I am very interested in this as a potential alternative to

Re: extern (c) struct ?

2018-03-08 Thread Adam D. Ruppe via Digitalmars-d-learn
On Thursday, 8 March 2018 at 15:51:53 UTC, Robert M. Münch wrote: I have a pretty complex struct with C++ typed private members etc. in it which I want to use from D. How are you accessing it? If it is by pointer only passing it to methods, you can simply: struct my_cpp_struct; and define

extern (c) struct ?

2018-03-08 Thread Robert M. Münch via Digitalmars-d-learn
I have a pretty complex struct with C++ typed private members etc. in it which I want to use from D. Obviously I don't want to/can't rebuild the struct definiton in D and I don't need access to all the members just some simple C API ones are enough. How can I get access to this struct from

Re: Thread Function does not executes

2018-03-08 Thread Vino via Digitalmars-d-learn
On Tuesday, 6 March 2018 at 09:01:55 UTC, Vino wrote: On Monday, 5 March 2018 at 13:50:28 UTC, Vino wrote: [...] Hi All, On further analysis, as to why the function deleteAgedDir is not getting executed, found that if this function finds a folder to be deleted then it should delete the