On 2012-09-10 01:27, timotheecour wrote:
Is there a way to use Object.factory with template classes?
eg:
----
class A(T){
T x;
}
auto a=Object.factory("A!int");
----
Right now this fails (returns null).
Use case:
If we had this, it would GREATLY simplify serialization (eg as in the
orange library) by not having to manually register subclasses of a given
class, eg:
class B{}
class C:B{int x;}
B c=new C;
right now with orange, we need to register class C before calling
serialization. If something like Object.factory("A!int") worked, this
step could be made automatic.
I don't understand how Object.factory could help with serializing. But
what would help is if we did get proper runtime reflection.
--
/Jacob Carlborg