InputArray is a reference, and references are always constant anyway. Making it const even causes a GCC warning.