Thread overview
How to overload new operator for all classes?
Aug 06, 2006
david
Aug 06, 2006
Thomas Kuehne
Aug 06, 2006
Hasan Aljudy
Aug 07, 2006
Thomas Kuehne
August 06, 2006
I know global operator overload is not supported in D, but I hope new could be an exception.
I want to write some kernel like program in D

-- 
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
August 06, 2006
david schrieb am 2006-08-06:
> I know global operator overload is not supported in D, but I hope new
> could be an exception.
> I want to write some kernel like program in D

Simply add the operator to the Object class in

src/phobos/internal/object.d

Thomas


August 06, 2006

Thomas Kuehne wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> david schrieb am 2006-08-06:
> 
>>I know global operator overload is not supported in D, but I hope new  could be an exception.
>>I want to write some kernel like program in D
> 
> 
> Simply add the operator to the Object class in
> 
> src/phobos/internal/object.d
> 
> Thomas
> 
> 
> -----BEGIN PGP SIGNATURE-----
> 
> iD8DBQFE1ZsCLK5blCcjpWoRAo1aAJwIqfbIXXaPOceaczTFN1K3cflCwACdFmFa
> YE22zhE/7sZi4OOxymtxQTQ=
> =Iwzp
> -----END PGP SIGNATURE-----

Are costume allocators inherited by subclasses?
August 07, 2006
Hasan Aljudy schrieb am 2006-08-06:
> Are costume allocators inherited by subclasses?

# import std.stdio;
#
# class A{
#     new(size_t size){
#         writefln("new(%s)", size);
#         return new byte[size];
#     }
# }
#
# class B : A{
#     int dummy;
# }
#
# int main(){
#     writef("new A: ");
#     A a = new A();
#
#     writef("new B: ");
#     B b = new B();
#
#     return 0;
# }

Thomas