new discovery: import only if available

Adam D. Ruppe destructionator at gmail.com
Fri Jun 21 12:15:45 PDT 2013


On Friday, 21 June 2013 at 18:47:24 UTC, Rainer Schuetze wrote:
> I guess you should move the "static if" outside of the template 
> to avoid having it evaluated for every type. This can be pretty 
> expensive as it includes a file search every time if it fails.

Probably.... also the __traits(compiles) in there is a mistake, 
because that breaks any static assert(0)'s in the extension code, 
so want to take that out too.

The other thing I'm thinking is maybe it should be a mixin 
template or something, because if it is supposed to be an 
extension, we don't want it completely replacing what druntime 
has. It should just add to it. This might need a cast and/or some 
indirection to keep straight through typeinfo.rtInfo() though.

> I'm unsure though if this is too brittle with respect to 
> linking something together that might be compiled with or 
> without these extensions.

The linker would probably complain about the symbol changing 
sizes if you did it wrong, There'd be some brittleness but maybe 
that's ok because not everyone would be tweaking this anyway.


More information about the Digitalmars-d mailing list