99. Constructors-I

Question.5

A UART driver disables copying:

class UART {
public:
   UART(int baud) { /* claim hardware */ }
   UART(const UART&) = delete; // No copying
};

UART u1(9600);
UART u2 = u1;  // Attempt to copy

Will UART u2 = u1 compile?

Need Help? Refer to the Quick Guide below

Select Answer