new discovery: import only if available
Sean Kelly
sean at invisibleduck.org
Wed Jun 19 11:53:27 PDT 2013
On Jun 18, 2013, at 7:37 PM, Adam D. Ruppe <destructionator at gmail.com> wrote:
>
> It returned true and false, so cool. If a module is available though, this test actually imports it and if you don't add its object file, you'll get a linker error:
>
> $ dmd test11
> true
> false
> test11.o:(.data+0x50): undefined reference to `_D4test12__ModuleInfoZ'
>
>
> But that might be ok, since if it is available, you'll probably be using it anyway - if not, why would you test? Though it would be cool if there was some kind of technique we could use such that it only pulls if the module is actually used elsewhere, like a low priority linker symbol or something. But I don't know about that.
rdmd?
More information about the Digitalmars-d
mailing list