Can't use toHexString

2015-07-19 Thread badlink via Digitalmars-d-learn
Hello, I get different results if I either use toHexString or crcHexString. I can't explain this behavior because crcHexString is just an alias of toHexString... Test code: http://pastebin.com/33Ye7yyJ

Re: Can't use toHexString

2015-07-19 Thread Kagamin via Digitalmars-d-learn
http://forum.dlang.org/post/ydaeytbyxdnwlbpwk...@forum.dlang.org

Re: Can't use toHexString

2015-07-19 Thread badlink via Digitalmars-d-learn
On Sunday, 19 July 2015 at 12:08:18 UTC, Adam D. Ruppe wrote: This line is illegal: return toHexString!(Order.decreasing)(crc.finish()); The std.digest.toHexString and variants return a *static array* which is static data and has a scope lifetime. It is horrendous a compiler bug that

Re: Can't use toHexString

2015-07-19 Thread badlink via Digitalmars-d-learn
On Sunday, 19 July 2015 at 12:00:23 UTC, Kagamin wrote: http://forum.dlang.org/post/ydaeytbyxdnwlbpwk...@forum.dlang.org Argh... must use the search function first... If I understand correctly in my case toHexString is returning a static char[len]. But why it gets silently converted to an

Re: Can't use toHexString

2015-07-19 Thread Adam D. Ruppe via Digitalmars-d-learn
This line is illegal: return toHexString!(Order.decreasing)(crc.finish()); The std.digest.toHexString and variants return a *static array* which is static data and has a scope lifetime. It is horrendous a compiler bug that allows it to implicitly convert to string - it should not compile

Re: Can't use toHexString

2015-07-19 Thread Johannes Pfau via Digitalmars-d-learn
Am Sun, 19 Jul 2015 12:08:16 + schrieb Adam D. Ruppe destructiona...@gmail.com: This line is illegal: return toHexString!(Order.decreasing)(crc.finish()); The std.digest.toHexString and variants return a *static array* which is static data and has a scope lifetime. It is