Fenvick tree implementation on C++11