Commit Graph

3 Commits

Author SHA1 Message Date
kimci86
669d9f53bc Update Text constructor static assert to use correct parameters 2023-08-05 14:39:07 -06:00
Chris Thrasher
3f4bb1ae12 Prevent constructing sf::Text with a temporary sf::Font
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>
2023-01-06 10:21:00 -07:00
Jonny Paton
e4bffe5b84 Rename test files to be unique 2022-10-23 16:39:12 +02:00