Re: How to initialize a associative array?

2016-12-24 Thread Carl Vogel via Digitalmars-d-learn
On Saturday, 24 December 2016 at 11:21:11 UTC, Stefan Koch wrote: You cannot initialize an AA at compile-time. Because AA's are provided by druntime and the ABI is not stable. This bit me when I was first starting out as well. I feel like there's really very little documentation on this, and

Re: Constraining template with function signature

2016-06-12 Thread Carl Vogel via Digitalmars-d-learn
On Thursday, 9 June 2016 at 19:08:52 UTC, cy wrote: But it's probably clearer to use that is(typeof({ how this function will be called })) trick. A very delayed thanks to both of you. It does seem like it would be useful to have something like a hasSignature!(Fun, Ret, Args...) defined in

Constraining template with function signature

2016-06-07 Thread Carl Vogel via Digitalmars-d-learn
Hi, What's the best way, when using a Callable as a template parameter, to constrain it by signature? For example, if you have a function that sorts an array like so: T[] sortArray(alias less, T)(T[] arr) { ... } Then you know that you'd want `less` to have signature (T, T) -> bool. Now,

Runtime.loadLibrary linker errors

2016-05-26 Thread Carl Vogel via Digitalmars-d-learn
Hi, Whenever I try to compile code that relies on Runtime.loadLibrary, I get a linker error during compilation. ``` Undefined symbols for architecture x86_64: "_rt_loadLibrary", referenced from: _D4core7runtime7Runtime17__T11loadLibraryZ11loadLibraryFxAaZPv in ll_test.o ld: