Re: Why doesn't this chain of ndslices work?

2016-05-14 Thread Seb via Digitalmars-d-learn
On Saturday, 14 May 2016 at 21:59:48 UTC, Stiff wrote: Here's the code that doesn't compile: import std.stdio, std.experimental.ndslice, std.range, std.algorithm; void main() { auto alloslice = [1, 2, 3, 4].sliced(1,4); auto sandwich = chain(alloslice,

Re: guard condition for a callable thingy, with THESE arguments

2016-05-14 Thread Ann W. Griffith via Digitalmars-d-learn
On Sunday, 15 May 2016 at 01:59:15 UTC, cy wrote: I take callbacks on occasion, and I don't really care if they're a delegate, or a function, or a callable object, and I can assert that in a template: void foo(Callable)(Callable callback) if(isSomeFunction!Callable || isCallable!Callable) {

guard condition for a callable thingy, with THESE arguments

2016-05-14 Thread cy via Digitalmars-d-learn
I take callbacks on occasion, and I don't really care if they're a delegate, or a function, or a callable object, and I can assert that in a template: void foo(Callable)(Callable callback) if(isSomeFunction!Callable || isCallable!Callable) { ... } That works, but it doesn't show you what

Re: Speed up `dub`.

2016-05-14 Thread cy via Digitalmars-d-learn
On Monday, 7 March 2016 at 09:18:37 UTC, ciechowoj wrote: I'm using `dub` to build project. And every time I run `dub` it seems to check if dependencies are up to date, which takes some time. Is there a way to switch of that checking? Or any other way to speed up building process? It really

Why doesn't this chain of ndslices work?

2016-05-14 Thread Stiff via Digitalmars-d-learn
Here's the code that doesn't compile: import std.stdio, std.experimental.ndslice, std.range, std.algorithm; void main() { auto alloslice = [1, 2, 3, 4].sliced(1,4); auto sandwich = chain(alloslice, (0).repeat(8).sliced(2,4), alloslice);

Re: Speed up `dub`.

2016-05-14 Thread ciechowoj via Digitalmars-d-learn
On Monday, 7 March 2016 at 21:56:11 UTC, Seb wrote: Use ld.gold - it will speed up your linking quite dramatically! https://code.dawg.eu/reducing-vibed-turnaround-time-part-1-faster-linking.html Thanks, it improves things a little. However I've just had idea that it should be possible to

Re: Defining member fuctions of a class or struct out side of the class/struct body?

2016-05-14 Thread Jonathan M Davis via Digitalmars-d-learn
On Friday, May 13, 2016 18:41:16 Jamal via Digitalmars-d-learn wrote: > Warning D newb here. > > Is it possible to define a member function outside of the > class/struct like in C++; > > class x { body > void foo(int* i); > }; > > void x::foo(int* i){ > *i++; > } > > Or is it just D-like

Re: Defining member fuctions of a class or struct out side of the class/struct body?

2016-05-14 Thread Jacob Carlborg via Digitalmars-d-learn
On 2016-05-13 20:41, Jamal wrote: Or is it just D-like to define everything inside the class/struct body? Yes, the D-way is to define everything directly inside the class/struct. -- /Jacob Carlborg

Re: How to split a string/array with multiple separators?

2016-05-14 Thread Joel via Digitalmars-d-learn
On Wednesday, 16 December 2015 at 15:27:22 UTC, Marc Schütz wrote: On Wednesday, 16 December 2015 at 14:47:26 UTC, Dragos Carp wrote: On Wednesday, 16 December 2015 at 14:18:28 UTC, Borislav Kosharov wrote: I want to split a string using multiple separators. In std.array the split function has