Re: Is this a good pattern for allocation?

2013-08-05 Thread JS
On Monday, 5 August 2013 at 12:41:19 UTC, Tobias Pankrath wrote: On Monday, 5 August 2013 at 08:11:59 UTC, JS wrote: I guess you mean that I should use a template as a factory instead of an interface? I'll have to think about it to see what the pro's and con's of each are. The interface patter

Re: Is this a good pattern for allocation?

2013-08-05 Thread Tobias Pankrath
On Monday, 5 August 2013 at 08:11:59 UTC, JS wrote: I guess you mean that I should use a template as a factory instead of an interface? I'll have to think about it to see what the pro's and con's of each are. The interface pattern should include the template pattern though. (after all, the in

Re: Is this a good pattern for allocation?

2013-08-05 Thread JS
On Monday, 5 August 2013 at 07:15:30 UTC, Tobias Pankrath wrote: On Monday, 5 August 2013 at 01:47:26 UTC, JS wrote: Anyways, is this a bad or good way and how can I call Factory to get a new object? (I know that ther is .init and other stuff that can be used by Factor/New. I'm just trying to g

Re: Is this a good pattern for allocation?

2013-08-05 Thread Tobias Pankrath
On Monday, 5 August 2013 at 01:47:26 UTC, JS wrote: Anyways, is this a bad or good way and how can I call Factory to get a new object? (I know that ther is .init and other stuff that can be used by Factor/New. I'm just trying to get the skeleton to compile and make sure there are not going to b

Is this a good pattern for allocation?

2013-08-04 Thread JS
Trying to avoid GC dependence on my objects. interface Alloc(T) { T New(A...)(A args); //final T Factory(A...)(T, A args) { return new T(args); } } class A(T) : Alloc!(A!(T)) { static A!T New() { return new A!T();// Use GC for now // Factor(A