119. Copy Semantics-I

Question.6

A UART driver deletes both copy operations:

class UART {
   volatile uint32_t* regs;
public:
   UART(uint32_t base) : regs((volatile uint32_t*)base) {}
   UART(const UART&) = delete;
   UART& operator=(const UART&) = delete;
};

UART u1(0x40011000);
UART u2 = u1;  // Attempt

Will UART u2 = u1 compile?

Need Help? Refer to the Quick Guide below

Select Answer