Boost logo

Boost :

From: David Abrahams (abrahams_at_[hidden])
Date: 2000-11-19 15:55:28

----- Original Message -----
From: "John (EBo) David" <ebo_at_[hidden]>

> Notes:
> as an aside, years ago I learned a little programming trick which I
> used above. By placing the literal on the left hand side of the
> expression I use compilers parser to catch certain types of typos.
> In this way if I inadvertently type a "=" instead of a "==" the
> compiler will see it as a syntax error. i.e. a "if (0=den)"
> produces a syntax error where as "if (den=0)" is valid but not what
> I wanted. Just an aside...

For the record, most compilers have a warning setting that will catch "if
(den = 0)". I much prefer enabling that warning to having to remember an odd
rule that produces hard-to-read code.

curmudgeon-ing-ly y'rs,

Boost list run by bdawes at, gregod at, cpdaniel at, john at