Similar Books


    No books found

Title
Chapter: 2 / Q: e.g2.5.1.3
A type alias is a type name and can appear wherever a type name can appear
Chapter: 2 / Q: e.g2.5.1.4
Declarations that use type aliases that represent compound types and const can yield surprising results. For example, the following declarations use the type pstring, which is an alias for the the type char*
Chapter: 2 / Q: e.g2.5.2.1
By implication, a variable that uses auto as its type specifier must have an initializer
Chapter: 2 / Q: e.g2.5.2.2
As with any other type specifier, we can define multiple variables using auto. Because a declaration can involve only a single base type, the initializers for all the variables in the declaration must have types that are consistent with each other
Chapter: 2 / Q: e.g2.5.2.3
First, as we’ve seen, when we use a reference, we are really using the object to which the reference refers. In particular, when we use a reference as an initializer, the initializer is the corresponding object. The compiler uses that object’s type for auto’s type deduction
Chapter: 2 / Q: e.g2.5.2.4
Second, auto ordinarily ignores top-level consts (§ 2.4.3, p. 63). As usual in initializations, low-level consts, such as when an initializer is a pointer to const, are kept
Chapter: 2 / Q: e.g2.5.2.5
If we want the deduced type to have a top-level const, we must say so explicitly
Chapter: 2 / Q: e.g2.5.2.6
We can also specify that we want a reference to the auto-deduced type. Normal initialization rules still apply
Chapter: 2 / Q: e.g2.5.2.7
When we define several variables in the same statement, it is important to remember that a reference or pointer is part of a particular declarator and not part of the base type for the declaration. As usual, the initializers must provide consistent auto-deduced types
Chapter: 2 / Q: e.g2.5.3.1
The way decltype handles top-level const and references differs subtly from the way auto does. When the expression to which we apply decltype is a variable, decltype returns the type of that variable, including top-level const and references
total questions: 591

Questions

591

Views

A PHP Error was encountered

Severity: Warning

Message: Undefined property: stdClass::$TotalViews

Filename: books/book.php

Line Number: 411

Best Answers

299

Points

5