D - Abstraction for primitive types?
- Helmut Leitner (18/18) Apr 21 2003 Is there an abstraction planned for primitive types?
- Walter (3/21) Apr 24 2003 The t.info should work now.
- Helmut Leitner (6/34) Apr 24 2003 What means "now"? In the next version DMD 0.62?
-
Walter
(3/7)
Apr 24 2003
Yes, unless I goofed it up
.
Is there an abstraction planned for primitive types? Something that would allow to write generic interfaces like TypeToUnistring(type t) { TypeInfo *pti=t.info; char buf[40]; int n=(*pti.toMem)(&t,buf); return MemRetUnistring(buf,n); } or void ArrayRandomize(type [] ar) { .... algorithm using swap from typeinfo .... } ? -- Helmut Leitner leitner hls.via.at Graz, Austria www.hls-software.com
Apr 21 2003
The t.info should work now. "Helmut Leitner" <helmut.leitner chello.at> wrote in message news:3EA3B257.6974D98D chello.at...Is there an abstraction planned for primitive types? Something that would allow to write generic interfaces like TypeToUnistring(type t) { TypeInfo *pti=t.info; char buf[40]; int n=(*pti.toMem)(&t,buf); return MemRetUnistring(buf,n); } or void ArrayRandomize(type [] ar) { .... algorithm using swap from typeinfo .... } ? -- Helmut Leitner leitner hls.via.at Graz, Austria www.hls-software.com
Apr 24 2003
Walter wrote:The t.info should work now.What means "now"? In the next version DMD 0.62?"Helmut Leitner" <helmut.leitner chello.at> wrote in message news:3EA3B257.6974D98D chello.at...-- Helmut Leitner leitner hls.via.at Graz, Austria www.hls-software.comIs there an abstraction planned for primitive types? Something that would allow to write generic interfaces like TypeToUnistring(type t) { TypeInfo *pti=t.info; char buf[40]; int n=(*pti.toMem)(&t,buf); return MemRetUnistring(buf,n); } or void ArrayRandomize(type [] ar) { .... algorithm using swap from typeinfo .... } ? -- Helmut Leitner leitner hls.via.at Graz, Austria www.hls-software.com
Apr 24 2003
"Helmut Leitner" <helmut.leitner chello.at> wrote in message news:3EA8443F.165D429E chello.at...Walter wrote:Yes, unless I goofed it up <g>.The t.info should work now.What means "now"? In the next version DMD 0.62?
Apr 24 2003