Take the 2-minute tour ×  I've been trying to design an
interface for a data class I'm writing. This class stores styles
for characters, for example whether the character is bold,
italic or underlined. But also the font-size and the font-
family. So it has different types of member variables. The
easiest way to implement this would be to add getters and
setters for every member variable, but this just feels wrong to
me. It feels way more logical (and more OOP) to call
style.format(BOLD, true) instead of style.setBold(true). So to
use logical methods instead of getters/setters.  But I am facing
two problems while implementing these methods: I would need a
big switch statement with all member variables, since you can't
access a variable by the contents of a string in C++. Moreover,
you can't overload by return type, which means you can't write
one getter like style.getFormatting(BOLD) (I know there are some
tricks to do this, but these don't allow for parameters, which I
would obviously need).  However, if I wou