Boost logo

Boost :

Subject: [boost] [array] compile-time checked access
From: Tobias Loew (Tobias.Loew_at_[hidden])
Date: 2012-11-05 03:50:39


I was just rewriting some old code with hard coded indices for array access
and though that compile-time checked access to array elements would be a
nice thing.
Maybe there are smart compilers out there that emit warnings or errors for a
hard coded out-of-bounds access, but my compiler does not.

So, code like

compiles without warnings or erros.
Now, adding the following functions to array

would make it possible to write

which results in the expected error messages.


View this message in context:
Sent from the Boost - Dev mailing list archive at

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