Question.2
A developer moves a UART driver and then attempts to use the source object:
UART
auto uart = std::make_unique<UART>(9600); auto logger = std::move(uart); uart->send(0x55); // Use after move
What happens?
Select Answer
Sends 0x55 successfully
0x55
Undefined behavior -- after std::move, uart is nullptr; dereferencing it causes a crash or hard fault
std::move
uart
nullptr
Compilation error -- moved-from objects cannot be used
The send goes to the logger instead