Medium
Counting bases in a diamond
What does this program print?
main.cpp
#include <iostream>
struct Base { int value = 1; };
struct Left : virtual Base {};
struct Right : virtual Base {};
struct Bottom : Left, Right {};
int main() {
Bottom b;
b.value = 42;
std::cout << static_cast<Left&>(b).value << " "
<< static_cast<Right&>(b).value << std::endl;
}46 of 117 in C++