Printing shortest decimal form of floating point number with Mir

jmh530 john.michael.hall at gmail.com
Mon Jan 4 20:14:58 UTC 2021


On Monday, 4 January 2021 at 17:24:42 UTC, John Colvin wrote:
> On Monday, 4 January 2021 at 17:22:55 UTC, John Colvin wrote:
>> On Monday, 4 January 2021 at 13:47:17 UTC, Ola Fosheim Grøstad 
>> wrote:
>>> [...]
>>
>> I have a longer reply I'm trying to write, but just to make 
>> sure I'm on the right track:
>>
>>     template Foo(T) {
>>         alias Foo = T;
>>     }
>>
>>     template Q(A : Foo!T, T) {
>>         pragma(msg, A.stringof, " ", T.stringof);
>>     }
>>
>>     alias X = Q!(Foo!int);
>>
>> in your opinion, this should compile and msg `int int`, yes?
>>
>> I'm trying to make a really concise example without using IFTI.
>
> and presumably the same for
>     alias X = Q!(int);
> yes?

Would this also imply:

enum bool Bar(A) = is(A : Foo!T, T);

void main() {
     static assert(Bar!(Foo!int));
     static assert(Bar!(int));
}


More information about the Digitalmars-d-announce mailing list