Which of the following template function definitions and invocations will not compile, if any? If not, why not?
Assume that classes have been declared with appropriate default constructors and assume that
```
//a)
template
A func( A x, A y){ return A(); }
int main()
{
U u1, u2, u3;
u2 = func(u2, u3);
}
//b.
template
B func() { return 1; }
int main()
{
T t;
t = func();
}
//c.
template
void func(C x, int * y){}
int main()
{
T t;
int i;
func( t, &i );
}
//d.
template
void func(D x, E y){}
int main()
{
T t;
U u;
func ( t, u );
}
```
The answers are somewhat compiler dependent. The only failure that my compilers detect is in compiling part b. The failure is due to a violation of the requirement that each template type argument be used in the function argument list. The template facility cannot determine the type of the template from the return type alone.
You might also like to view...
The following session shows the commands needed to perform the task. The tar archive is in the ~/labs.tar file.
What will be an ideal response?
Which is not one of the four basic symbols used to chart data movement on data flow diagrams?
A) an oval B) arrow C) rectangle with rounded corners D) open-ended rectangle
Case-Based Critical Thinking QuestionsCase 4-2Jake is an expert in the use of the Property inspector to create precisely the attributes he needs for the AP divs that he creates, with regard to when the AP div's content is displayed or hidden and how it relates to its parent AP div if it is nested. Jake knows that if the AP div is hidden when the page is loaded, different actions by the user can make it visible. Which of the following settings does he select to use the browser's default visibility?
A. Inherit B. Basic C. Main D. Default
The Solarize filter is a member of the ____________________ category.
Fill in the blank(s) with the appropriate word(s).