mirror of
https://github.com/SFML/SFML.git
synced 2025-02-18 06:18:01 +08:00
By deleting this constructor overload, it fails to compile if you pass a temporary font to this parameter slot. That includes code like sf::Text text("", sf::Font()); but more importantly it prohibits code like this sf::Font getFont() { sf::Font font; // load a font... return font; } sf::Text text("", getFont()); The same idea can be applied to setFont() to prevent setting fonts from a temporary. Credit to Jonny for the idea Co-authored-by: JonnyPtn <jonathan.r.paton@googlemail.com>