You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Provide a way to activate new features. We could piggyback off the version feature for this. First we need to know if the "activate new features" feature is supported. We can do this by defining a version in the compiler when it is supported, i.e.
version (CanActivateFeatures)
{
}
If your source code requires new features, you could so something like
version (CanActivateFeatures)
{
//...
}
elsestaticassert(0, "This code does not work with this compiler, it does not support activating new features");
Then to activate new features, you could use versions as well
version (CanActivateFeatures
{
version = EnableInterpolatedStrings;
}
You can also do this:
version (CanActivateFeatures
{
version (SupportsInterpolatedStrings)
{
version = EnableInterpolatedStrings;
}
elsestaticassert (0, "This code requires InterpolatedString support");
}
The text was updated successfully, but these errors were encountered:
Provide a way to activate new features. We could piggyback off the
version
feature for this. First we need to know if the "activate new features" feature is supported. We can do this by defining a version in the compiler when it is supported, i.e.version (CanActivateFeatures) { }
If your source code requires new features, you could so something like
Then to activate new features, you could use versions as well
You can also do this:
The text was updated successfully, but these errors were encountered: