Unmanaged - a D framework on github
D-Ratisueur
qskjlkqdj at sjhds.fr
Sat Mar 30 08:38:42 PDT 2013
On Wednesday, 20 March 2013 at 15:50:27 UTC, Benjamin Thaut wrote:
> Am 20.03.2013 13:42, schrieb Jacob Carlborg:
>> On 2013-03-20 08:57, Benjamin Thaut wrote:
>>
>>> You still can't replace evertything with custom alloc
>>> templates and have
>>> nice syntax. There are at least two cases where it does not
>>> work nicely:
>>>
>>> 1) Arrays (no new T [size] syntax)
>>> 2) Inner classes (a template can't automatically capture the
>>> outer class)
>>>
>>> So I think overloading new and delete actually has its place.
>>> But the
>>> way it is currently implemented in D is useless in my eyes.
>>
>> Instead of having a special keyword like we have now. We could
>> have, as
>> has been suggested before, a regular function or method.
>>
>> With a class, there's also the possibility to return a
>> different type or
>> a singleton:
>>
>> class Foo
>> {
>> Foo new ()
>> {
>> return Bar.new();
>> }
>> }
>>
>> class Bar : Foo {}
>>
>
> But with a regular function you always have the problem that
> you need to pass the constructor argumnets along. If there are
> implict conversion form literals to constructor arguments
> neccessary this will fail as soon as you pass them through a
> function.
>
> Kind Regards
> Benjamin Thaut
Its too late...errors are made,anyway you got the stuff:
http://www.youtube.com/watch?v=KZKAVl_qX_Y. I Should wait a few
weeks before announcing "Unmanaged"...I feel quite shamefull
right now...
More information about the Digitalmars-d-announce
mailing list