dcollections 1.0 and 2.0a beta released
superdan
super at dan.org
Fri May 21 09:31:38 PDT 2010
== Quote from Steven Schveighoffer (schveiguy at yahoo.com)'s article
> superdan Wrote:
> > == Quote from Steven Schveighoffer (schveiguy at yahoo.com)'s article
> > > Is there some other reason to use structs besides copy construction?
> > > -Steve
> >
> > memory management n shit. with a struct u can use refcounting n malloc n realloc n
> > shit. still stays a reference type. nothing gets fucked up.
> This is not necessary with purely memory-based constructs -- the GC is your
friend. The custom allocator ability in dcollections should provide plenty of
freedom for memory allocation schemes.
how do u set up yer custom allocator to free memory? u cant tell when its ok.
copying refs iz under da radar. dats my point.
> > den there's all that null ref shit. with a class u have
> >
> > void foo(container!shit poo)
> > {
> > poo.addElement(Shit(diarrhea));
> > }
> >
> > dat works with struct but don't work with motherfucking classes. u need to write.
> >
> > void foo(container!shit poo)
> > {
> > if (!poo) poo = new container!shit; // fuck dat shit
> > poo.addElement(Shit(diarrhea));
> > }
> >
> > u feel me?
> It doesn't work.
wut? it don't work? whaddaya mean it dun work? is you crazy? what dun work? maybe
therez sum misundercommunication. repeating. if container is struct this shit works:
void foo(container!shit poo)
{
poo.addElement(Shit(diarrhea));
}
dun tell me it dun work. i dun explain shit again. it works coz a struct cant be
null. but a struct can be a ref if it only haz one pointer inside. methinks the
builtin hash iz dat way.
if container iz class dat shit dun work. u need to write dis shit:
void foo(container!shit poo)
{
if(!poo) poo = new container!shit; // fuck dat shit
poo.addElement(Shit(diarrhea));
}
dat sucks bull ballz.
More information about the Digitalmars-d-announce
mailing list