bit_array::calc_count should be declared as

unsigned calc_count(bool val,int start,unsigned count) const

so you can use calc_count on a constant bit_array.