I need help in understanding the following C++ code (in a .h file):
bool setFontDescription(const FontDescription& v)
{
if (inherited->font.fontDescription() != v) {
inherited.access()->font = Font(v, inherited->font.letterSpacing(), inherited->font.wordSpacing());
return true;
}
return false;
}
What does ‘Font(..)’ mean? Font is a C++ class. Does Font(…) mean new Font()? Or create a Font object on the stack?
Create a Font object on stack, as a temporary. The object’s scope is the line where it’s created.