SFML/include/SFML
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
..
Audio Use in-class member initializers 2023-01-02 16:26:51 -07:00
Graphics Prevent constructing sf::Text with a temporary sf::Font 2023-01-06 10:21:00 -07:00
Network Simplify in-class initializer expressions 2023-01-03 14:51:44 -07:00
System Mark move operators as noexcept 2023-01-04 09:49:20 -07:00
Window Simplify in-class initializer expressions 2023-01-03 14:51:44 -07:00
Audio.hpp Replaced Header Guards with Pragma Once 2022-12-27 20:08:11 +01:00
Config.hpp Replaced Header Guards with Pragma Once 2022-12-27 20:08:11 +01:00
GpuPreference.hpp Replaced Header Guards with Pragma Once 2022-12-27 20:08:11 +01:00
Graphics.hpp Replaced Header Guards with Pragma Once 2022-12-27 20:08:11 +01:00
Main.hpp Replaced Header Guards with Pragma Once 2022-12-27 20:08:11 +01:00
Network.hpp Replaced Header Guards with Pragma Once 2022-12-27 20:08:11 +01:00
OpenGL.hpp Replaced Header Guards with Pragma Once 2022-12-27 20:08:11 +01:00
System.hpp Replaced Header Guards with Pragma Once 2022-12-27 20:08:11 +01:00
Window.hpp Replaced Header Guards with Pragma Once 2022-12-27 20:08:11 +01:00