void main returning int - why compiles?

David Nadlinger see at klickverbot.at
Sat Jan 1 13:43:03 PST 2011

On 1/1/11 10:08 PM, Simen kjaeraas wrote:
> This is by design, the feature is made for generic functions. Consider:
> ReturnType!Fn wrap( alias Fn )( ParameterTypeTuple!Fn args ) {
> return Fn( args );
> }

I am not sure if this simple argument is valid – if Fn was of return 
type void, you would, type-wise, have »return void;« in a function 
returning void, which is clearly different from having »return someInt;« 
in a function returning void…


More information about the Digitalmars-d-learn mailing list