Search code examples
c++c++11language-lawyerconstantsauto

Is 'auto const' and 'const auto' the same?


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


Solution

  • 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.