Boost logo

Boost Users :

From: Merrill Cornish (merrill.cornish_at_[hidden])
Date: 2005-08-04 09:00:38


>>> My point is only that one can add a compile time safe accessor to
>>> this array.

True. It could be added. But how often would it (could it) ever be used?

Look through your source code. How often do you see an expression like arrayName[i] versus and expression like arrayName[257]? The compiler could check 257 against the declared array length, but not i. And yet, in most code you very seldom have any constant array indexes that could be checked at compile time.

So, yes, it could be done. But if you had it, you would almost never find anyplace to use it.

Merrill


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net