Work around MSVC compiler bug dropping `const`.
MSVC seems to drop the const from the underlying Const**ReturnType
when trying to match the out-of-line definition of transpose() and
diagonal() to the declaration. When using is_same and is_const
to inspect the types the const is actually there... it's just
ignored when trying to find the corresponding definition.
Adding an extra const seems to fix this.
Fixes #2464 (closed)