/*
CS371p: Quiz #24 (5 pts)
*/
/* -----------------------------------------------------------------------
1. What is the output of the following program?
You must get the newlines right to get full credit.
Write the word "blank" to indicate a blank line.
(4 pts)
A(A)
A(A<U>)
A(A<U>) =(A)
*/
#include <iostream> // cout, endl
using namespace std;
template <typename T>
struct A {
A ()
{}
A (const A& other) {
cout << "A(A)" << " ";}
template <typename U>
A (const A<U>& other) {
cout << "A(A<U>)" << " ";}
A& operator = (const A& rhs) {
cout << "=(A)" << " ";
return *this;}};
int main () {
A<int> x;
A<int> y = x;
cout << endl;
A<double> z = x;
cout << endl;
z = y;
cout << endl;
return 0;}
syntax highlighted by Code2HTML, v. 0.9.1