Getting whether it's Tango or Phobos

Bill Baxter dnewsgroup at
Mon May 19 16:57:11 PDT 2008

Robert Fraser wrote:
> Bill Baxter wrote:
>> Robert Fraser wrote:
>>> Is there a reliable way to deduce whether the user is using Tango or 
>>> Phobos? I used to use:
>>> static if(is(typeof(object.toUtf8)))
>>> But since that got changed to toString that doesn't work right now. 
>>> For the time being, I can verify it's D1 and then use (with Tango 
>>> 0.99.6)
>>> static if(!is(typeof(string)))
>>> But I'm guessing Tango may be given a string type soon...?
>> version(Tango) { ... } else { ... }  ?
>> --bb
> That requires the user to specify -version=Tango . I'm looking for 
> something that can be compiled with either Tango or Phobos without 
> asking anything of the user.

But it's part of the standard Tango install/setup procedure.  If you 
follow the instructions for how to install Tango, then you will always 
have -version=Tango set when using Tango.  Are you worried about the 
case where someone has not followed Tango's install procedures properly?


More information about the Digitalmars-d-learn mailing list