Re: Is it possible to store different generic types in ex. an

2016-11-09 Thread Ali Çehreli via Digitalmars-d-learn
On 11/09/2016 07:44 AM, Is it possible to store different generic types? wrote: Is it possible to store different generic types in ex. somekind of container such as an array, hashtable etc. Let's say we got class Foo(T) { ... } Would it be possible to store something like Foo[] foos; //

Re: Is it possible to store different generic types in ex. an

2016-11-09 Thread Is it possible to store different generic types? via Digitalmars-d-learn
On Wednesday, 9 November 2016 at 15:44:59 UTC, Is it possible to store different generic types? wrote: Is it possible to store different generic types in ex. somekind of container such as an array, hashtable etc. Let's say we got class Foo(T) { ... } Would it be possible to store

Is it possible to store different generic types in ex. an

2016-11-09 Thread Is it possible to store different generic types? via Digitalmars-d-learn
Is it possible to store different generic types in ex. somekind of container such as an array, hashtable etc. Let's say we got class Foo(T) { ... } Would it be possible to store something like Foo[] foos; // Where Foo of course should allow any generic version of Foo Ex. Foo!int and

Re: Reflecting over mutating member functions

2016-11-09 Thread Jonathan M Davis via Digitalmars-d-learn
On Wednesday, November 09, 2016 12:21:19 Nordlöw via Digitalmars-d-learn wrote: > How do I iterate over all the `this`-mutating (non-`const` > qualified) member functions of an aggregate (class/struct)? __traits(allMembers, T) can be used to get a Tuple/AliasSeq of strings of the names of all of

Reflecting over mutating member functions

2016-11-09 Thread Nordlöw via Digitalmars-d-learn
How do I iterate over all the `this`-mutating (non-`const` qualified) member functions of an aggregate (class/struct)?

Re: Obtain predicate from SortedRange

2016-11-09 Thread Ali Çehreli via Digitalmars-d-learn
On 11/09/2016 02:02 AM, Jonathan M Davis via Digitalmars-d-learn wrote: On Wednesday, November 09, 2016 09:37:18 RazvanN via Digitalmars-d-learn wrote: Given a SortedRange object, is there a way to obtain the predicate which was used for it to be sorted? No. It only exists as a template

Re: Obtain predicate from SortedRange

2016-11-09 Thread Jonathan M Davis via Digitalmars-d-learn
On Wednesday, November 09, 2016 09:37:18 RazvanN via Digitalmars-d-learn wrote: > Given a SortedRange object, is there a way to obtain the > predicate which was used for it to be sorted? No. It only exists as a template argument to SortedRange and an alias within it, not as something that's

Obtain predicate from SortedRange

2016-11-09 Thread RazvanN via Digitalmars-d-learn
Given a SortedRange object, is there a way to obtain the predicate which was used for it to be sorted?

Re: Difference between dstring and string format specifiers support. Bug?

2016-11-09 Thread Ali Çehreli via Digitalmars-d-learn
On 11/09/2016 01:20 AM, Ali Çehreli wrote: > arrayPtrDiff() is at the bottom of the same file but works correctly > only for char strings: > > https://github.com/dlang/phobos/blob/master/std/format.d#L6573 What I meant is, using arrayPtrDiff() is correct only for char strings. Otherwise,

Re: Difference between dstring and string format specifiers support. Bug?

2016-11-09 Thread Ali Çehreli via Digitalmars-d-learn
On 11/09/2016 12:21 AM, Vadim Lopatin wrote: Looks like bug. dchar[] and wchar[] format strings support less specifiers than char[] import std.format; string test1 = "%02d".format(1); // works assert(test1 == "01"); dstring test2 = "%d"d.format(1); // works

Difference between dstring and string format specifiers support. Bug?

2016-11-09 Thread Vadim Lopatin via Digitalmars-d-learn
Looks like bug. dchar[] and wchar[] format strings support less specifiers than char[] import std.format; string test1 = "%02d".format(1); // works assert(test1 == "01"); dstring test2 = "%d"d.format(1); // works assert(test2 == "1"d); wstring

Re: Difference between dstring and string format specifiers support. Bug?

2016-11-09 Thread Vadim Lopatin via Digitalmars-d-learn
On Wednesday, 9 November 2016 at 08:21:53 UTC, Vadim Lopatin wrote: Looks like bug. dchar[] and wchar[] format strings support less specifiers than char[] import std.format; string test1 = "%02d".format(1); // works assert(test1 == "01"); dstring test2 =