Minor detail: could perhaps use const reference. Const alone is slightly unnecessary on by-value parameters.