Filling a char array with letters and element type of char[]

Jonathan M Davis via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue Mar 3 05:08:58 PST 2015


On Tuesday, March 03, 2015 09:06:03 Tobias Pankrath via Digitalmars-d-learn wrote:
>
> > I have three questions?
> >
> > If I change the iterator which I get from algorithm, the owner
> > data will change or not?
> >
> > How to use std.algorithm.fill with char types?
> >
> > What is the type of char array holds why it does not matches
> > char?
> >
> > Regards
> > Kadir Erdem
>
> I have no time to dig into this, but:
>
> is(typeof(arr.front = 'a')) does _not_ check if arr.front is of
> type char. It is true if you can assign an 'a' to arr.front.
>
> is(typeof(_expr_)) is another way to write __traits(compiles,
> _expr).
>
> So, either the range returned by until has elements that are not
> assignable or the reason is that until returns a range of dchar,
> because all string types are treated as ranges of dchar.

http://stackoverflow.com/questions/6401365

- Jonathan M Davis



More information about the Digitalmars-d-learn mailing list