Re: What does std.traits.hasAliasing do

2018-08-02 Thread Steven Schveighoffer via Digitalmars-d-learn
On 7/28/18 9:21 PM, Venkat wrote: On Sunday, 29 July 2018 at 01:05:19 UTC, Venkat wrote: struct SomeStruct { string p; string q; string[] pq; } Session session = req.session; session.get!SomeStruct("registerBody"); /home/venkat/.dub/packages/vibe-d-0.8.4/vibe-d/http/vibe/http/ses

Re: Why does templated interface function return something different than final function?

2018-08-02 Thread Steven Schveighoffer via Digitalmars-d-learn
On 7/18/18 7:09 AM, Timoses wrote: Why is the interface templated function not also returning the class C toString return value "in C"?? interface iface {     void toString(scope void delegate(const(char)[]) sink) const;     final string convert() inout     {

Re: Prime number

2018-08-02 Thread Stefan Koch via Digitalmars-d-learn
On Thursday, 2 August 2018 at 08:30:05 UTC, Greatsam4sure wrote: I know D is very powerful from my little experience. What is the idiomatic way to get prime numbers say from 1-30 without using loops(outer and inner loop). Can map, filter, fold etc in algorithm be use. Pls show some code with c

Re: Prime number

2018-08-02 Thread Greatsam4sure via Digitalmars-d-learn
On Thursday, 2 August 2018 at 09:35:20 UTC, Cym13 wrote: On Thursday, 2 August 2018 at 08:30:05 UTC, Greatsam4sure wrote: I know D is very powerful from my little experience. What is the idiomatic way to get prime numbers say from 1-30 without using loops(outer and inner loop). Can map, filter,

Re: Where is TypeInfo_Class.m_init set

2018-08-02 Thread Hakan Aras via Digitalmars-d-learn
On Thursday, 2 August 2018 at 10:54:17 UTC, kinke wrote: Those 4 bytes for the struct is trailing padding, so that the struct is 16 bytes large, a multiple of its 8-bytes alignment (due to the pointer). Classes on the other hand aren't padded (they don't need to be, as there are no contiguous

Re: Disabling opAssign in a type disabled all the opAssigns of an aliased type?

2018-08-02 Thread aliak via Digitalmars-d-learn
On Tuesday, 31 July 2018 at 07:01:33 UTC, Simen Kjærås wrote: On Monday, 30 July 2018 at 23:41:09 UTC, aliak wrote: https://issues.dlang.org/show_bug.cgi?id=19130 Beautiful. :) Would it take much to fix it up to use with templated opAssigns as well? I spent half an hour doing silly things,

Re: How to force console

2018-08-02 Thread Adam D. Ruppe via Digitalmars-d-learn
On Thursday, 2 August 2018 at 13:11:20 UTC, Everlast wrote: But, when I put this stuff in a static this in a windowsx64 dll, the static this is called about 100 times!!! Not once! try shared static this() instead of just static this() the latter is called once per thread, the former once

Re: How to force console

2018-08-02 Thread Everlast via Digitalmars-d-learn
On Thursday, 2 August 2018 at 13:02:21 UTC, Simen Kjærås wrote: On Thursday, 2 August 2018 at 12:08:50 UTC, Everlast wrote: On Thursday, 2 August 2018 at 03:20:30 UTC, Mike Parker wrote: On Wednesday, 1 August 2018 at 20:57:30 UTC, Everlast wrote: I can create a console for a dll using AllocCon

Re: How to force console

2018-08-02 Thread Simen Kjærås via Digitalmars-d-learn
On Thursday, 2 August 2018 at 12:08:50 UTC, Everlast wrote: On Thursday, 2 August 2018 at 03:20:30 UTC, Mike Parker wrote: On Wednesday, 1 August 2018 at 20:57:30 UTC, Everlast wrote: I can create a console for a dll using AllocConsole and special Write functions but this is a pain. How do I ge

Re: Dlang on OpenWrt

2018-08-02 Thread Radu via Digitalmars-d-learn
On Thursday, 2 August 2018 at 10:47:33 UTC, Ky-Anh Huynh wrote: Hi, can I build my program on OpenWrt? I haven't found any resources on internet maybe I'm missing something. Thanks a lot. LDC 1.10+ should have pretty good support for OpenWRT uClibc for ARM, and some support for uClibc MIPS

Re: How to force console

2018-08-02 Thread Everlast via Digitalmars-d-learn
On Thursday, 2 August 2018 at 03:20:30 UTC, Mike Parker wrote: On Wednesday, 1 August 2018 at 20:57:30 UTC, Everlast wrote: I can create a console for a dll using AllocConsole and special Write functions but this is a pain. How do I get all standard input and output to either use this console o

Re: Dlang on OpenWrt

2018-08-02 Thread kinke via Digitalmars-d-learn
You could give LDC's armhf build a try. It's built on Debian Jessie and requires ARMv6 or newer, so it might work. Download: https://github.com/ldc-developers/ldc/releases

Re: pointer cast from const(Y) to immutable(void*)** is not supported at compile time

2018-08-02 Thread kinke via Digitalmars-d-learn
On Thursday, 2 August 2018 at 02:13:41 UTC, Hakan Aras wrote: I do want it at compiletime though. Totally understandable; that's a regression and needs to be fixed. See https://github.com/dlang/dmd/pull/8362#pullrequestreview-142565787.

Re: Where is TypeInfo_Class.m_init set

2018-08-02 Thread kinke via Digitalmars-d-learn
On Thursday, 2 August 2018 at 02:52:44 UTC, Hakan Aras wrote: LDC complains about the type of initializer though: onlineapp.d(22): Error: Global variable type does not match previous declaration with same mangled name: _D5bclib3Baz6__initZ onlineapp.d(22):Previous IR type: %bclib.Baz =

Dlang on OpenWrt

2018-08-02 Thread Ky-Anh Huynh via Digitalmars-d-learn
Hi, can I build my program on OpenWrt? I haven't found any resources on internet maybe I'm missing something. Thanks a lot.

Re: Prime number

2018-08-02 Thread Cym13 via Digitalmars-d-learn
On Thursday, 2 August 2018 at 08:30:05 UTC, Greatsam4sure wrote: I know D is very powerful from my little experience. What is the idiomatic way to get prime numbers say from 1-30 without using loops(outer and inner loop). Can map, filter, fold etc in algorithm be use. Pls show some code with c

Re: Prime number

2018-08-02 Thread Dennis via Digitalmars-d-learn
On Thursday, 2 August 2018 at 08:30:05 UTC, Greatsam4sure wrote: I know D is very powerful from my little experience. What is the idiomatic way to get prime numbers say from 1-30 without using loops(outer and inner loop). Can map, filter, fold etc in algorithm be use. Pls show some code with c

Prime number

2018-08-02 Thread Greatsam4sure via Digitalmars-d-learn
I know D is very powerful from my little experience. What is the idiomatic way to get prime numbers say from 1-30 without using loops(outer and inner loop). Can map, filter, fold etc in algorithm be use. Pls show some code with chain call. I can easily achieve even numberd and odd numbers usi