Strange casting error when using lamdas

Steven Schveighoffer schveiguy at gmail.com
Wed Dec 4 19:23:07 UTC 2019


On 12/3/19 12:35 PM, Robert M. Münch wrote:
> The first three lines are on module level, the second two lines are 
> inside a class member function.
> 
> pragma(msg,WM_MOUSEMOVE_LBUTTON_STREAM.sizeof);
> 
>>> 8LU
> 
> but
> 
> pragma(msg,windows_message_streams[WM_MOUSEMOVE].filter!(win => 
> (win.wParam & MK_LBUTTON)).sizeof);
> 
>>> 16LU
> 
> Why do these two things have different sizes even the declaration is 
> exactly the same?
> 

Is one a delegate and one a function pointer? This can easily happen for 
untyped lambdas.

-Steve


More information about the Digitalmars-d-learn mailing list