On Monday, 2 May 2016 at 04:19:48 UTC, earthfront wrote:
On Sunday, 1 May 2016 at 19:18:38 UTC, Basile B wrote:
CT make(CT, Alloc, A...)(auto ref Alloc al, A a)
This works. Thank you. Good point about __ctor alone not being
sufficient.
auto memory = al.allocate(size);
...
On Sunday, 1 May 2016 at 19:18:38 UTC, Basile B wrote:
CT make(CT, Alloc, A...)(auto ref Alloc al, A a)
This works. Thank you. Good point about __ctor alone not being
sufficient.
auto memory = al.allocate(size);
...
GC.addRange(memory.ptr, size, typeid(CT));
Nit:
On Sun, 01 May 2016 18:27:51 +
Lass Safin via Digitalmars-d-learn
wrote:
> On Sunday, 1 May 2016 at 11:17:27 UTC, earthfront wrote:
> > Hello!
> > [...]
> > class A
> >{ int b; private this(int a){b=a;} }
> > [...]
>
> I don't think classes are
On Sunday, 1 May 2016 at 11:17:27 UTC, earthfront wrote:
Hello!
This code fails:
-
void main(){
class A
{ int b; private this(int a){b=a;} }
//{ int b; this(int a){b=a;} }
import std.conv:emplace;
import std.experimental.allocator.mallocator:Mallocator;
import
On Sunday, 1 May 2016 at 11:17:27 UTC, earthfront wrote:
Hello!
[...]
class A
{ int b; private this(int a){b=a;} }
[...]
I don't think classes are supposed to be able to have a private
constructor...
Hello!
This code fails:
-
void main(){
class A
{ int b; private this(int a){b=a;} }
//{ int b; this(int a){b=a;} }
import std.conv:emplace;
import std.experimental.allocator.mallocator:Mallocator;
import std.experimental.allocator:make;
{
auto ptr =