Question: Consider the following code in C + + : class string _ map { string cached _ key; string cached _ val; const string complex
Consider the following code in C:
class stringmap
string cachedkey;
string cachedval;
const string complexlookupconst string key;
body specified elsewhere public:
const string operatorconst string key if key cachedkey return cachedval; string rtnval complexlookupkey; cachedkey key;
cachedval rtnval;
return rtnval;
;
Suppose that stringmap::operator contains the only call to complex lookup anywhere in the program. Explain why it would be unwise for the programmer to expand that call textually inline and eliminate the separate function.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
