On Fri, 13 Feb 2009 03:51:01 +0100, Justin wrote:
I'm trying to instantiate a templated class at runtime and having some
trouble. My thought is that since something like "Collection!(int)" will
return a valid classinfo, I ought to be able to use ClassInfo.find() and
then .create:
module
Ary Borenszweig wrote:
Christopher Wright wrote:
Justin wrote:
Is there a way to "find" a classinfo for such a class at runtime?
The slow way:
foreach (modul; ModuleInfo)
foreach (info; modul.localClasses)
if (info.name == name) return info;
return null;
It doesn't work. It see
"Christopher Wright" wrote
> Justin wrote:
>> Is there a way to "find" a classinfo for such a class at runtime?
>
> The slow way:
>
> foreach (modul; ModuleInfo)
> foreach (info; modul.localClasses)
> if (info.name == name) return info;
> return null;
If you look at the source for ClassInfo.find,
Christopher Wright wrote:
Justin wrote:
Is there a way to "find" a classinfo for such a class at runtime?
The slow way:
foreach (modul; ModuleInfo)
foreach (info; modul.localClasses)
if (info.name == name) return info;
return null;
It doesn't work. It seems only top level classe
Justin wrote:
Is there a way to "find" a classinfo for such a class at runtime?
The slow way:
foreach (modul; ModuleInfo)
foreach (info; modul.localClasses)
if (info.name == name) return info;
return null;
On Fri, 13 Feb 2009 17:38:46 +1300, Steve Schveighoffer
wrote:
On Thu, 12 Feb 2009 21:51:01 -0500, Justin wrote:
Is there a way to "find" a classinfo for such a class at runtime?
I can't see anything incorrect about what you are doing. Certainly the
source for druntime seems to indicate
On Thu, 12 Feb 2009 21:51:01 -0500, Justin wrote:
> Is there a way to "find" a classinfo for such a class at runtime?
I can't see anything incorrect about what you are doing. Certainly the
source for druntime seems to indicate it should work.
This is probably a compiler bug.
-Steve
I'm trying to instantiate a templated class at runtime and having some trouble.
My thought is that since something like "Collection!(int)" will return a valid
classinfo, I ought to be able to use ClassInfo.find() and then .create:
module test;
import std.stdio;
void main() {
myClass!(