Here are several function members of a class. Tell whether each may be used as an l-value, only, an r-value only or both. B is a class that has mutators.
a) ```
//declarations of these appear together in the //definition of class A
int& A::f( ){ /* */}
const int& A::f( )const{ /* */}
```
b) ```
const int& A::f( ){ /* */}
```
c) ```
const B A::f( ){ /* */}
```
d) ```
B A::f( ){ /* */}
```
In a) the first will be used if f() is used as an l-value, and the second implementation will be used if f() is used as an r-value.
In b) f() can be used as an r-value only.
In c) f() can be used as an r-value only and no mutators can be called on the return value.
In d) f() can be used as an r-value only, but mutators can be called on the return value
You might also like to view...
The maximum number of rows and columns you can create by splitting a cell ____.
A. is 10 B. is 20 C. is 30 D. depends on the cell's width and height
This statement needs to define rate as .1. #define rate = .1; Which is true?
A. There should not be a ; at the end of the line. B. It’s correct as is. C. The = should be omitted. D. The = should be omitted and the ; should be omitted.
Does the function call in the following function cause syntax errors?
```
#include
Which of the following is TRUE about a wireless network?
A) It does not need a router. B) Wireless networks can only connect PCs if they are in the line of sight. C) Cables are not required. D) Wireless networks are usually faster than wired networks.