Mysteries of the Underscore

H. S. Teoh hsteoh at quickfur.ath.cx
Mon Dec 24 16:16:01 UTC 2018


On Mon, Dec 24, 2018 at 02:45:24PM +0000, bauss via Digitalmars-d-learn wrote:
[...]
> The underscore does nothing and it's just an identifier.
> 
> Really it just means "unused". It's frequently used in loops to.

Rather, it's *conventionally* taken to mean "unused".  The language
actually does not treat it in any special way apart from "normal"
identifiers.  It's perfectly valid (though probably not recommended!) to
declare functions or variables with the name "_" and use them.


T

-- 
Knowledge is that area of ignorance that we arrange and classify. -- Ambrose Bierce


More information about the Digitalmars-d-learn mailing list