top-level const
As we’ve seen, a pointer is an object that can point to a different object. As a result, we can talk independently about whether a pointer is const and whether the objects to which it can point are const. we use the top-level const to indicate that the pointer itself is a const. When a pointer can point to a const object, we refer to that const as a low-level const.
More generally, top-level const indicates that an object itself is const. Top-level const can appear in any object type,i.e., one of the built-in arithmetic types, a class type, or a pointer type. Low-level const appears in the base type of compound types such as pointer or reference. Note that pointer types, unlike most other type, can have both top-level and low-level const independently:
int i= 0;
int *const p1= &i; // we can't change the value of p1;const is top-level
const int ci= 42; // we can't change ci;const is top-level
const int *p2= &ci; // we can't change p2;cosnt is low-level
const int *const p3= p2; // right-most const is top-level,left-most is not
const int &r= ci; // const in reference types is always low-level
The auto Type Specifier
It is not uncommon to want to store the value of an expression in a variable. To declare the variable, we have to know the type of that expression. When we write a program, it can be surprisingly difficult–and sometimes even impossible–to determine the type of an expression. Under the new standard, we can let the compiler figure out the type for us by using the auto type specifier. Unlike type specifiers, such as double, that names a specifier type, auto tells the compiler to deduce the type from the initi