Extract typeinfo

Namespace rswhite4 at googlemail.com
Wed Mar 5 11:15:11 PST 2014


Is there a way to extract the correct typeinfo of an array if I 
only have the pointer?

Code:
----
import std.stdio;

struct Foo {
	int i;
}

void foo(void* p) {
     // ???
}

void main() {
     Foo[] fs;
     fs ~= Foo();

     foo(fs.ptr);
}
----

Now that we have only the untyped void*: Is there a way how I can 
extract the right typeinfo? Something to rebuild the correct type 
out of the adress.


More information about the Digitalmars-d-learn mailing list