Having two const's for a type issues a warning / error. However if the type has been defined with typedef, the compiler accepts it (both Visual Studio 2013 and the online compiler C++ shell).
#include <iostream>
typedef const int value_type;
int main()
{
const value_type n = 0; //ok
const const int n2 = 0; //error C4114
return 0;
}
Does anyone have an idea as to why? Is it that one is const (const int), which is different from const const int?