Questions on the new __traits(parameters)

Timon Gehr timon.gehr at gmx.ch
Thu Mar 10 22:13:30 UTC 2022


On 10.03.22 13:27, Adam D Ruppe wrote:
> On Thursday, 10 March 2022 at 10:18:09 UTC, Quirin Schroll wrote:
>> The issue is not the complexity of the workaround (example below), but 
>> that it is in practice hard to know when it applies and it is *hard to 
>> teach*
> 
> 
> __traits(parameters) always gives the parameters of the function in 
> which it is used *even if it is used inside a nested function*.
> 

It is not used inside a nested function. It is used within a foreach 
loop. Different rules apply. Or are you arguing that (like Steve pointed 
out already), return statements in opApply foreach loop bodies should 
return from the delegate because "return always returns from the 
function in which it is used *even if it is used inside a nested function*?


More information about the Digitalmars-d mailing list