Function prototype + definition in the same file

Maxim Fomin maxim at maxim-fomin.ru
Tue Sep 25 11:57:01 PDT 2012


On Tuesday, 25 September 2012 at 17:48:46 UTC, deadalnix wrote:
> This is code duplication and is generally considered as a bad 
> practice. I'm not convinced that the language should be 
> modified to allow something that is known as bad practice.
>
> What you need here is a more robust di generator IMO.

This is neither a code duplication (there is certain distinction 
between prototype and body) nor a bad practice - this is a common 
pattern in C and C++. It is surprising that D cannot do such a 
simple thing which in addition is not harmless, so there is no 
sense in depreciating it.


More information about the Digitalmars-d mailing list