Will be nice if I got 'nested members' in D language, so I have the inglorious idea to code
class Keyboard
{
struct Unused {
string key1 = "Wake Up";
string key2 = "Sleep";
string key3 = "Power";
}
Unused unused;
}
int main()
{
Keyboard kb;
kb.unused.key1 = "Scroll Lock";
return 0;
}
Okay, it's a bad example that segfault too. But I'm learning object-oriented programming and don't know if it's a good thing to do, or how to do.