Re: Embedded Containers

2017-12-05 Thread Mike Parker via Digitalmars-d
On Tuesday, 5 December 2017 at 19:13:10 UTC, A Guy With a Question wrote: Ok, so that worked. I still have the problem with importing though: mypackage: Item seems to generate the error: "Error: undefined identifier 'Item'" Which is weird, because I'm able to bring in Array through

Re: Embedded Containers

2017-12-05 Thread A Guy With a Question via Digitalmars-d
On Tuesday, 5 December 2017 at 22:21:51 UTC, Jonathan M Davis wrote: On Tuesday, December 05, 2017 22:09:12 A Guy With a Question via Digitalmars-d wrote: Is there actually a difference between the c style cast and cast(type)? Other than verbosity... They're not the same. D's cast is not

Re: Embedded Containers

2017-12-05 Thread Jonathan M Davis via Digitalmars-d
On Tuesday, December 05, 2017 22:09:12 A Guy With a Question via Digitalmars-d wrote: > Is there actually a difference between the c style cast and > cast(type)? Other than verbosity... They're not the same. D's cast is not split up like C++'s casts are, but it's not exactly the same as C's cast

Re: Embedded Containers

2017-12-05 Thread A Guy With a Question via Digitalmars-d
On Tuesday, 5 December 2017 at 20:38:01 UTC, Timon Gehr wrote: On 05.12.2017 20:11, H. S. Teoh wrote: On Tue, Dec 05, 2017 at 07:09:50PM +, Adam D. Ruppe via Digitalmars-d wrote: On Tuesday, 5 December 2017 at 19:01:48 UTC, A Guy With a Question wrote: alias Items(T) = Array!Item(T);

Re: Embedded Containers

2017-12-05 Thread Timon Gehr via Digitalmars-d
On 05.12.2017 20:11, H. S. Teoh wrote: On Tue, Dec 05, 2017 at 07:09:50PM +, Adam D. Ruppe via Digitalmars-d wrote: On Tuesday, 5 December 2017 at 19:01:48 UTC, A Guy With a Question wrote: alias Items(T) = Array!Item(T); try: Array!(Item!(T)) I'm not quite sure I understand how to

Re: Embedded Containers

2017-12-05 Thread A Guy With a Question via Digitalmars-d
On Tuesday, 5 December 2017 at 19:19:50 UTC, colin wrote: On Tuesday, 5 December 2017 at 19:13:10 UTC, A Guy With a Question wrote: On Tuesday, 5 December 2017 at 19:09:50 UTC, Adam D. Ruppe wrote: [...] Ok, so that worked. I still have the problem with importing though: mypackage: Item

Re: Embedded Containers

2017-12-05 Thread H. S. Teoh via Digitalmars-d
On Tue, Dec 05, 2017 at 07:09:50PM +, Adam D. Ruppe via Digitalmars-d wrote: > On Tuesday, 5 December 2017 at 19:01:48 UTC, A Guy With a Question wrote: > > alias Items(T) = Array!Item(T); > > try: > > Array!(Item!(T)) > > > I'm not quite sure I understand how to create a generic container

Re: Embedded Containers

2017-12-05 Thread colin via Digitalmars-d
On Tuesday, 5 December 2017 at 19:13:10 UTC, A Guy With a Question wrote: On Tuesday, 5 December 2017 at 19:09:50 UTC, Adam D. Ruppe wrote: [...] Ok, so that worked. I still have the problem with importing though: mypackage: Item seems to generate the error: "Error: undefined identifier

Re: Embedded Containers

2017-12-05 Thread A Guy With a Question via Digitalmars-d
On Tuesday, 5 December 2017 at 19:09:50 UTC, Adam D. Ruppe wrote: On Tuesday, 5 December 2017 at 19:01:48 UTC, A Guy With a Question wrote: alias Items(T) = Array!Item(T); try: Array!(Item!(T)) I'm not quite sure I understand how to create a generic container interface or class in D.

Re: Embedded Containers

2017-12-05 Thread John Chapman via Digitalmars-d
On Tuesday, 5 December 2017 at 19:01:48 UTC, A Guy With a Question wrote: The following doesn't appear to be valid syntax. Array!Item!T I get the following error: "multiple ! arguments are not allowed" Which is ok...I get THAT error, however, this does not work either: alias

Re: Embedded Containers

2017-12-05 Thread Adam D. Ruppe via Digitalmars-d
On Tuesday, 5 December 2017 at 19:01:48 UTC, A Guy With a Question wrote: alias Items(T) = Array!Item(T); try: Array!(Item!(T)) I'm not quite sure I understand how to create a generic container interface or class in D. Just using the parenthesis should help. The thing with A!B!C is that

Re: Embedded Containers

2017-12-05 Thread A Guy With a Question via Digitalmars-d
Ah crud, I posted this to the wrong forum. Sorry.

Embedded Containers

2017-12-05 Thread A Guy With a Question via Digitalmars-d
The following doesn't appear to be valid syntax. Array!Item!T I get the following error: "multiple ! arguments are not allowed" Which is ok...I get THAT error, however, this does not work either: alias Items(T) = Array!Item(T); This gives me the error: Error: function declaration