Re: Container templates

2014-02-21 Thread Meta
On Thursday, 20 February 2014 at 18:55:06 UTC, Frustrated wrote: This should work. Just have to add the overrides and call the base function(e.g., "override" insert and then call x's insert). This at least gets the job done... I wonder if there is a better way? If you want a.Add() (insert() in

Re: Container templates

2014-02-20 Thread Frustrated
On Wednesday, 19 February 2014 at 21:50:43 UTC, Meta wrote: On Wednesday, 19 February 2014 at 19:44:12 UTC, Meta wrote: On Wednesday, 19 February 2014 at 19:10:44 UTC, Frustrated wrote: Are there container templates that one can mixin to classes that give them container behavior? e.g

Re: Container templates

2014-02-19 Thread Meta
On Wednesday, 19 February 2014 at 19:44:12 UTC, Meta wrote: On Wednesday, 19 February 2014 at 19:10:44 UTC, Frustrated wrote: Are there container templates that one can mixin to classes that give them container behavior? e.g., instead of class A { Array!int x; } I want class A

Re: Container templates

2014-02-19 Thread monarch_dodra
On Wednesday, 19 February 2014 at 19:44:12 UTC, Meta wrote: On Wednesday, 19 February 2014 at 19:10:44 UTC, Frustrated wrote: Are there container templates that one can mixin to classes that give them container behavior? e.g., instead of class A { Array!int x; } I want class A

Re: Container templates

2014-02-19 Thread Frustrated
On Wednesday, 19 February 2014 at 19:44:12 UTC, Meta wrote: On Wednesday, 19 February 2014 at 19:10:44 UTC, Frustrated wrote: Are there container templates that one can mixin to classes that give them container behavior? e.g., instead of class A { Array!int x; } I want class A

Re: Container templates

2014-02-19 Thread Meta
On Wednesday, 19 February 2014 at 19:10:44 UTC, Frustrated wrote: Are there container templates that one can mixin to classes that give them container behavior? e.g., instead of class A { Array!int x; } I want class A { mixin Array!int; } so that I can do something like a.Add(3

Container templates

2014-02-19 Thread Frustrated
Are there container templates that one can mixin to classes that give them container behavior? e.g., instead of class A { Array!int x; } I want class A { mixin Array!int; } so that I can do something like a.Add(3) instead of a.x.Add(3). In fact, I do want the first case because I