const vs. lazy initialization
I like lazy initialization like this:
const char *get_name(void) {
if (NULL == name_) {
name_ = generate_name();
}
return name_;
}
Lately I've also started liking const as a method modifier. This doesn't play nicely with lazy initialization:
char *get_name(void) const {
if (NULL == name_) {
name_ = generate_name(); <--- ERROR!
}
return name_;
}
I'm not sure how to elegantly combine the two.

Brilliant!
The "mutable" keyword is what you want here. It lets you write methods like get_name() which are "conceptually const" but which internally update some cached state.
Eg. mutable const char * name_;