Implementing bounds-checking with exceptions based on an existing bitset container
It doesn't really matter which direction you do the checking in - it's a matter of personal preference. Both are valid, semantically identical, and will almost certainly perform identically. 

One thing you can do to avoid having to rewrite all of this stuff is to have a single function that does bounds-checking:

size_t boundsChecked(size_t coord) const {
    // whichever order of this you prefer
    if (coord &gt;= _length) {
        throw std::out_of_range(...);
    }
    return coord;
}


And then defer to that function everywhere you want to add bounds checking:

bool operator[](size_t coord) const
{    
    return data[boundsChecked(coord)];
}