Re: Linker error under Ubuntu

2020-05-14 Thread evilrat via Digitalmars-d-learn
On Thursday, 14 May 2020 at 16:09:16 UTC, solidstate1991 wrote: When I try to compile my own project under Ubuntu with dub, I get the following linker error: /usr/bin/ld: .dub/obj/pixelperfectengine_pixelperfecteditor.o: undefined reference to symbol 'inflateEnd' //lib/x86_64-linux-gnu/libz.so

Style Questionss Regarding Protection Levels

2020-05-14 Thread farm via Digitalmars-d-learn
I've got two questions. The first one is whether the labels for protection levels (e.g. private) should be indented like the rest of an aggregate's members. The second one is where should one place private members of a module, e.g. on the bottom, top, near where they're used (in the case of hel

Re: Handle FormatSpec!char in the virtual toString() method of a class.

2020-05-14 Thread H. S. Teoh via Digitalmars-d-learn
On Wed, May 13, 2020 at 12:26:21PM +, realhet via Digitalmars-d-learn wrote: > Hello, > > Is there a way to the following thing in a class instead of a struct? > > -- > static struct Point > { > int x, y; > > void toString(W)(ref W writer, scope co

Compiler bug ? -preview=intpromote and Integral promotion rules not being followed for unary + - ~ operators

2020-05-14 Thread wjoe via Digitalmars-d-learn
I have a container which provides access to data via a handle. For book keeping I calculate some bitmasks. Previously, when the handle type as well as the constants were uint, everything compiled fine. Today I added a template parameter to be able to specify the handle type and I ran into this p

Re: Error running concurrent process and storing results in array

2020-05-14 Thread data pulverizer via Digitalmars-d-learn
On Wednesday, 13 May 2020 at 15:13:50 UTC, wjoe wrote: On Friday, 8 May 2020 at 13:43:40 UTC, data pulverizer wrote: [...] I also chose kernel matrix calculations, you can't always call a library, sometimes you just need to write performant code. Aren't kernel function calls suffering a conte

Linker error under Ubuntu

2020-05-14 Thread solidstate1991 via Digitalmars-d-learn
When I try to compile my own project under Ubuntu with dub, I get the following linker error: /usr/bin/ld: .dub/obj/pixelperfectengine_pixelperfecteditor.o: undefined reference to symbol 'inflateEnd' //lib/x86_64-linux-gnu/libz.so.1: error adding symbols: DSO missing from command line collect

Re: How to include my own library in my d program with dub ?

2020-05-14 Thread JN via Digitalmars-d-learn
On Thursday, 14 May 2020 at 12:53:43 UTC, Vinod K Chandran wrote: Hi all, I just build a skeleton of a Gui library(win32 based) for my own purpose. How do i use this in my d programs with dub ? Now, all files are located in a folder called "GuiLib". Side note : Why i started making a gui librar

How to include my own library in my d program with dub ?

2020-05-14 Thread Vinod K Chandran via Digitalmars-d-learn
Hi all, I just build a skeleton of a Gui library(win32 based) for my own purpose. How do i use this in my d programs with dub ? Now, all files are located in a folder called "GuiLib". Side note : Why i started making a gui library instead of learning language ? Answer : By this way, i can learn

Re: DScanner warns class is undocumented, how to resolve it ?

2020-05-14 Thread Vinod K Chandran via Digitalmars-d-learn
On Thursday, 14 May 2020 at 08:02:28 UTC, Dennis wrote: On Thursday, 14 May 2020 at 06:08:17 UTC, Vinod K Chandran wrote: On Thursday, 14 May 2020 at 06:05:00 UTC, Vinod K Chandran wrote: Hi all, I wrote a class and in VS Code, DScanner says that the class is undocumented. How can i document a

Re: DScanner warns class is undocumented, how to resolve it ?

2020-05-14 Thread Vinod K Chandran via Digitalmars-d-learn
On Thursday, 14 May 2020 at 11:25:48 UTC, Cogitri wrote: On Thursday, 14 May 2020 at 06:08:17 UTC, Vinod K Chandran wrote: [...] Also see https://dlang.org/spec/ddoc.html for more info on DDoc. FWIW you can also disable the warning by adding the following to VSCode's settings.json: "dscann

Re: Easy way to format int in pragma msg ?

2020-05-14 Thread wjoe via Digitalmars-d-learn
On Thursday, 14 May 2020 at 10:58:34 UTC, WebFreak001 wrote: On Thursday, 14 May 2020 at 09:49:15 UTC, wjoe wrote: Is there an easy way to print an int in hexadecimal, octal or binary representation ? The documentation on pragma(msg, ...) and a quick web search didn't provide an answer. for

Re: DScanner warns class is undocumented, how to resolve it ?

2020-05-14 Thread Cogitri via Digitalmars-d-learn
On Thursday, 14 May 2020 at 06:08:17 UTC, Vinod K Chandran wrote: On Thursday, 14 May 2020 at 06:05:00 UTC, Vinod K Chandran wrote: Hi all, I wrote a class and in VS Code, DScanner says that the class is undocumented. How can i document a class ? Never mind, i found the answer myself. Just li

Re: Easy way to format int in pragma msg ?

2020-05-14 Thread WebFreak001 via Digitalmars-d-learn
On Thursday, 14 May 2020 at 09:49:15 UTC, wjoe wrote: Is there an easy way to print an int in hexadecimal, octal or binary representation ? The documentation on pragma(msg, ...) and a quick web search didn't provide an answer. for simple hex/binary/etc printing use import std.conv; prag

Re: Easy way to format int in pragma msg ?

2020-05-14 Thread John Chapman via Digitalmars-d-learn
On Thursday, 14 May 2020 at 09:49:15 UTC, wjoe wrote: Is there an easy way to print an int in hexadecimal, octal or binary representation ? The documentation on pragma(msg, ...) and a quick web search didn't provide an answer. import std.string; pragma(msg, format("%x", 10)); %x = hex %

Easy way to format int in pragma msg ?

2020-05-14 Thread wjoe via Digitalmars-d-learn
Is there an easy way to print an int in hexadecimal, octal or binary representation ? The documentation on pragma(msg, ...) and a quick web search didn't provide an answer.

Re: D and Async I/O

2020-05-14 Thread Russel Winder via Digitalmars-d-learn
On Tue, 2020-05-12 at 20:05 +0200, Jacob Carlborg via Digitalmars-d-learn wrote: > On 2020-05-12 11:23, Russel Winder wrote: > > > As far as I can tell D has no futures… > > Future and async in vibe.d [1]. Future in Mecca [2]. > > [1] https://vibed.org/api/vibe.core.concurrency/async > [2] > h

Re: D and Async I/O

2020-05-14 Thread Russel Winder via Digitalmars-d-learn
On Tue, 2020-05-12 at 09:57 +, Sebastiaan Koppe via Digitalmars-d-learn wrote: […] > > Yeah it is a shame, but you see it in almost every language. > Probably means concurrency and io isn't a fully solved problem > yet. Whilst C frameworks use callbacks and trampolines, high level languages

Re: Sum string lengths

2020-05-14 Thread Andrey via Digitalmars-d-learn
Thanks everyone.

Re: DScanner warns class is undocumented, how to resolve it ?

2020-05-14 Thread Dennis via Digitalmars-d-learn
On Thursday, 14 May 2020 at 06:08:17 UTC, Vinod K Chandran wrote: On Thursday, 14 May 2020 at 06:05:00 UTC, Vinod K Chandran wrote: Hi all, I wrote a class and in VS Code, DScanner says that the class is undocumented. How can i document a class ? Never mind, i found the answer myself. Just li