Out parameters and initialization

Ivan Senji ivan.senji_REMOVE_ at _THIS__gmail.com
Sun Feb 26 01:53:59 PST 2006


Unknown W. Brackets wrote:
> Except aliases and typedefs (exactly, as I could tell, for the reason of 
> consistency) do not use an = sign.  If they did, it would be strange and 
> inconsistent.  I am very glad they do not.
> 
> Personally, I think = should be disallowed entirely for out parameters, 
> and should work on inout parameters in the same way as it does for in 
> ones.  This would stay logical.
> 
> If out int i = 5 should not compile when no parameter is passed, it 
> should not compile when a parameter is passed - as you said.  

No, it should never compile.

> I think 
> the usefulness of global variables, especially considering thread 
> safety, would only grow confusing in actual and practical use.

Maybe, but noone is stoping you from implementing thread safe access to 
global variable if thread safety is what you need.



More information about the Digitalmars-d-bugs mailing list