Re: wstring comparison is failing

2019-09-24 Thread Vladimir Panteleev via Digitalmars-d-learn
On Tuesday, 24 September 2019 at 21:40:47 UTC, Brett wrote: The only issue is that buggy dynamic code can result if someone compares the two and it will fail silently. But, you don't know if the static array actually contains a null-terminated string (in which case the comparison is a bug) or

Re: wstring comparison is failing

2019-09-24 Thread Brett via Digitalmars-d-learn
On Tuesday, 24 September 2019 at 00:29:05 UTC, Vladimir Panteleev wrote: On Monday, 23 September 2019 at 23:22:14 UTC, Brett wrote: I guess you are probably right... I was thinking that it would compare up to a null terminator. Seems kinda buggy... maybe the compiler needs to give a warning?

Inspecting __traits(isDeprecated) and deprecation warnings

2019-09-24 Thread Anonymouse via Digitalmars-d-learn
I want to write a piece of code that reflects on the names of members of a passed struct, where some are depreacted. https://run.dlang.io/is/P9EtRG struct Foo { string s; int ii; bool bbb; deprecated("Use `s`") string ; } template longestMemberLength(T) { enum

Blog Post #73: The Frame, Part II

2019-09-24 Thread Ron Tarrant via Digitalmars-d-learn
Today we cover how to decorate the Frame... or UN-decorate it. Frames can be turned off or dressed up with CSS. To find out more, follow this link: https://gtkdcoding.com/2019/09/24/0073-frame-part-ii.html

Re: Why dynamic array is InputRange but static array not.

2019-09-24 Thread Jonathan M Davis via Digitalmars-d-learn
On Tuesday, September 24, 2019 1:35:24 AM MDT lili via Digitalmars-d-learn wrote: > Hi: >in phobos/std/range/primitives.d has this code > ``` > static assert( isInputRange!(int[])); > static assert( isInputRange!(char[])); > static assert(!isInputRange!(char[4])); > static

Why dynamic array is InputRange but static array not.

2019-09-24 Thread lili via Digitalmars-d-learn
Hi: in phobos/std/range/primitives.d has this code ``` static assert( isInputRange!(int[])); static assert( isInputRange!(char[])); static assert(!isInputRange!(char[4])); static assert( isInputRange!(inout(int)[])); ``` but the dynamic array and static array neither not has