Re: range algorithms on container class

2020-01-18 Thread Jonathan M Davis via Digitalmars-d-learn
On Wednesday, January 15, 2020 9:13:05 AM MST Paul Backus via Digitalmars-d- learn wrote: > On Thursday, 9 January 2020 at 10:26:07 UTC, Jonathan M Davis > > wrote: > > On Wednesday, January 8, 2020 10:56:20 PM MST rikki cattermole > > > > via Digitalmars-d-learn wrote: > >> Slicing via the opSlice

Re: CTFE and assoc array

2020-01-18 Thread Boris Carvajal via Digitalmars-d-learn
On Saturday, 18 January 2020 at 20:54:20 UTC, Andrey wrote: Hello, Why this doesn't work? import std; struct Qwezzz { shared static this() { qaz = qazMap; } enum qazMap = ["rrr": "vv", "hty": "4ft6"]; static immutable string[string] qaz; } void main() { e

CTFE and assoc array

2020-01-18 Thread Andrey via Digitalmars-d-learn
Hello, Why this doesn't work? import std; struct Qwezzz { shared static this() { qaz = qazMap; } enum qazMap = ["rrr": "vv", "hty": "4ft6"]; static immutable string[string] qaz; } void main() { enum sorted = Qwezzz.qaz.keys.sort(); } The variable "qaz" i

Re: DMD docker image

2020-01-18 Thread Andre Pany via Digitalmars-d-learn
On Saturday, 18 January 2020 at 13:58:01 UTC, Jan Hönig wrote: On Friday, 17 January 2020 at 17:31:29 UTC, Andre Pany wrote: If you really need small images, you could switch to Alpine, but MUSL c could lead to headaches ;) There are also the official docker images https://hub.docker.com/u/dl

Re: How to call 'shared static this()' code of a D shared library?

2020-01-18 Thread Ali Çehreli via Digitalmars-d-learn
On 1/18/20 6:14 AM, Guillaume Piolat wrote: On Saturday, 18 January 2020 at 03:53:43 UTC, Adam D. Ruppe wrote: Did you already try rt_init? That should trigger it Indeed, this is done by runtime initialization. Thank you, Adam and Guillaume. That tells me I've been using druntime withou

Re: How to call 'shared static this()' code of a D shared library?

2020-01-18 Thread Adam D. Ruppe via Digitalmars-d-learn
btw there is also a `pragma(crt_constructor)` thing you can put on individual functions for pure C runtime init things.

Re: How to call 'shared static this()' code of a D shared library?

2020-01-18 Thread Guillaume Piolat via Digitalmars-d-learn
On Saturday, 18 January 2020 at 03:53:43 UTC, Adam D. Ruppe wrote: Did you already try rt_init? That should trigger it Indeed, this is done by runtime initialization.

Re: DMD docker image

2020-01-18 Thread Jan Hönig via Digitalmars-d-learn
On Friday, 17 January 2020 at 17:31:29 UTC, Andre Pany wrote: If you really need small images, you could switch to Alpine, but MUSL c could lead to headaches ;) There are also the official docker images https://hub.docker.com/u/dlang2 What is your goal? Do you want to compile s.th. in your d

Re: import/format tools?

2020-01-18 Thread Boris Carvajal via Digitalmars-d-learn
On Saturday, 18 January 2020 at 09:33:34 UTC, mark wrote: Is there a tool that will sort imports (e.g., as per the style guide), and that will also add the specific names used? D-Scanner[1] will warn you about non sorted imports You need to set imports_sortedness="enabled" on your dscanner.ini

import/format tools?

2020-01-18 Thread mark via Digitalmars-d-learn
Is there a tool that will sort imports (e.g., as per the style guide), and that will also add the specific names used? Also, is there a D source formatting tool (ideally with options to set a max line length and choice of braces style)? Is there any runtime (or compiletime) cost to just listi