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
it's trying __traits(compiles on text_, which isn't a template in it's own right, so if you've got to the check then it must pass. Also text_ can end up not returning. I guess making it a no-arg template would fix the problem? Idk.
The text was updated successfully, but these errors were encountered:
If text_ doesn't compile, then the whole convertToString template cannot be instantiated.
The pattern is essentially this:
template A(T) {
void foo() { potentiallyBad!T(); }
static if (__traits(compiles, foo())) {
enum A = 0;
} else {
enum A = 1;
}
}
There is no way that A!(X) can ever be 1, regardless of X and regardless of the implementation of potentiallyBad. Either A!(X) is 0 or it fails to compile.
Now in your case there is one small difference: convertToString takes its argument as const, which means you are indeed checking whether T : const(T). But is that what was actually intended?
it's trying
__traits(compiles
ontext_
, which isn't a template in it's own right, so if you've got to the check then it must pass. Alsotext_
can end up not returning. I guess making it a no-arg template would fix the problem? Idk.The text was updated successfully, but these errors were encountered: