'auto const' 和 'const auto' 是一样的吗?

'auto const' 和 'const auto' 是一样的吗?

问题描述:

auto constconst auto 之间是否存在语义差异,或者它们的意思相同?

Is there a semantic difference between auto const and const auto, or do they mean the same thing?

const 限定符适用于紧邻左边的类型,除非左边没有任何东西,否则它适用于左边的类型立即正确.所以是的,它是一样的.

The const qualifier applies to the type to the immediate left unless there is nothing to the left then it applies to the type to the immediate right. So yup it's the same.