Which operator+, if any, is selected for each of the addition expressions? List the candidate functions, the viable functions, and the type conversions on the arguments for each viable function:
struct LongDouble { // member operator+for illustration purposes; + is usually a nonmember LongDouble operator+(const SmallInt&); // other members as in § 14.9.2 (p. 587)};LongDouble operator+(LongDouble&, double);SmallInt si;LongDouble ld;ld = si + ld;ld = ld + si;§ 14.9.2 (p. 587)
Exercise 14.50
Show the possible class-type conversion sequences for the initializations of ex1 and ex2. Explain whether the initializations are legal or not.
struct LongDouble { LongDouble(double = 0.0); operator double(); operator float();};LongDouble ldObj;int ex1 = ldObj;float ex2 = ldObj;Exercise 14.51
Show the conversion sequences (if any) needed to call each version of calc and explain why the best viable function is selected.
void calc(int);void calc(LongDouble);double dval;calc(dval); // which calc?
We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.