Re: Char representation

2016-11-22 Thread RazvanN via Digitalmars-d-learn
On Tuesday, 22 November 2016 at 14:23:28 UTC, Jonathan M Davis wrote: On Tuesday, November 22, 2016 13:29:47 RazvanN via Digitalmars-d-learn wrote: [...] You misunderstand. char[] is a dynamic array of char, wchar[] is a dynamic array of wchar[], and dchar[] is a dynamic array of dchar.

Re: Char representation

2016-11-22 Thread Kagamin via Digitalmars-d-learn
On Tuesday, 22 November 2016 at 13:29:47 UTC, RazvanN wrote: Given the following code: char[5] a = ['a', 'b', 'c', 'd', 'e']; alias Range = char[]; writeln(is(ElementType!Range == char)); One would expect that the program will print true. In fact, it prints false and I noticed that if

Re: Char representation

2016-11-22 Thread Jonathan M Davis via Digitalmars-d-learn
On Tuesday, November 22, 2016 13:29:47 RazvanN via Digitalmars-d-learn wrote: > Given the following code: > > char[5] a = ['a', 'b', 'c', 'd', 'e']; > alias Range = char[]; > writeln(is(ElementType!Range == char)); > > One would expect that the program will print true. In fact, it > prints

Re: Char representation

2016-11-22 Thread Adam D. Ruppe via Digitalmars-d-learn
On Tuesday, 22 November 2016 at 13:29:47 UTC, RazvanN wrote: Is this a bug? The language is sane. The standard library is not alas, it is insane by design, so not a bug.

Re: Char representation

2016-11-22 Thread Daniel Kozak via Digitalmars-d-learn
Dne 22.11.2016 v 14:29 RazvanN via Digitalmars-d-learn napsal(a): Given the following code: char[5] a = ['a', 'b', 'c', 'd', 'e']; alias Range = char[]; writeln(is(ElementType!Range == char)); One would expect that the program will print true. In fact, it prints false and I noticed that

Re: Char representation

2016-11-22 Thread Daniel Kozak via Digitalmars-d-learn
Dne 22.11.2016 v 14:29 RazvanN via Digitalmars-d-learn napsal(a): Given the following code: char[5] a = ['a', 'b', 'c', 'd', 'e']; alias Range = char[]; writeln(is(ElementType!Range == char)); One would expect that the program will print true. In fact, it prints false and I noticed that

Re: Char representation

2016-11-22 Thread Stefan Koch via Digitalmars-d-learn
On Tuesday, 22 November 2016 at 13:29:47 UTC, RazvanN wrote: Given the following code: char[5] a = ['a', 'b', 'c', 'd', 'e']; alias Range = char[]; writeln(is(ElementType!Range == char)); One would expect that the program will print true. In fact, it prints false and I noticed that if

Re: Char representation

2016-11-22 Thread rikki cattermole via Digitalmars-d-learn
On 23/11/2016 2:29 AM, RazvanN wrote: Given the following code: char[5] a = ['a', 'b', 'c', 'd', 'e']; alias Range = char[]; writeln(is(ElementType!Range == char)); One would expect that the program will print true. In fact, it prints false and I noticed that if Range is char[], wchar[],

Char representation

2016-11-22 Thread RazvanN via Digitalmars-d-learn
Given the following code: char[5] a = ['a', 'b', 'c', 'd', 'e']; alias Range = char[]; writeln(is(ElementType!Range == char)); One would expect that the program will print true. In fact, it prints false and I noticed that if Range is char[], wchar[], dchar[], string, wstring, dstring