How to check that import module will succeed?

Adam D. Ruppe destructionator at gmail.com
Fri Jul 26 15:21:22 UTC 2019


On Friday, 26 July 2019 at 03:42:58 UTC, Andrey Zherikov wrote:
> Is there a way to check whether some module, say "foo", is 
> available for import before doing "import foo"?


   static if (is(typeof((){import that.module.here;}))) {
     // it is available
   }




More information about the Digitalmars-d-learn mailing list