Code block as template argument

Ali Çehreli acehreli at yahoo.com
Tue Feb 11 19:42:06 UTC 2020


On 2/11/20 7:32 AM, Виталий Фадеев wrote:> On Tuesday, 11 February 2020 
at 15:08:11 UTC, Ali Çehreli wrote:
 >> On 2/11/20 6:58 AM, Andrea Fontana wrote:
 >>
 >>>> > Analog C-code with macros:
 >>>> >      #define TPL(M,D,CODE) if ( state & M && diraction = D )
 >>>>
 >>>>                                                ^^^^^^^^^^^^^
 >>
 >>> The C code apparently does an assignment inside the macro.
 >>>
 >>
 >> I still think it's a typo. :)
 >>
 >> Ali
 >
 > Thank. You understand me rigth, but your presented code too big.
 > We love simple, beauty.

I love simple and beautiful more than you do. :) The D code I've shown 
is virtually identical to the C macro if you rename my 'executeMaybe' to 
your 'TPL'.

Ali




More information about the Digitalmars-d mailing list