Type Parameter Deduction

Ali Çehreli acehreli at yahoo.com
Tue May 10 15:49:27 UTC 2022


On 5/10/22 08:40, Salih Dincer wrote:

 > void inclusiveRange(T)(T Args...) if(is(T == bool)) {
 >    assert(0, "\nBoolean type cannot be used!");
 > }

Of course, 'static assert' is better there because it will catch the 
issue at compile time.

     static assert(0, "\nBoolean type cannot be used!");

Ali



More information about the Digitalmars-d-learn mailing list