Remove unnecessary default destructor

sf::RenderWindow still inherits a virtual destructor from a base
class so there's no need to explicitly declare a virtual destructor.
I added a test to ensure this property was not broken.
This commit is contained in:
Chris Thrasher 2024-01-08 11:31:33 -07:00
parent a9d9ef6d83
commit 4346b9a8bc
3 changed files with 1 additions and 12 deletions

View File

@ -96,14 +96,6 @@ public:
////////////////////////////////////////////////////////////
explicit RenderWindow(WindowHandle handle, const ContextSettings& settings = ContextSettings());
////////////////////////////////////////////////////////////
/// \brief Destructor
///
/// Closes the window and frees all the resources attached to it.
///
////////////////////////////////////////////////////////////
~RenderWindow() override;
////////////////////////////////////////////////////////////
/// \brief Get the size of the rendering region of the window
///

View File

@ -52,10 +52,6 @@ RenderWindow::RenderWindow(WindowHandle handle, const ContextSettings& settings)
}
////////////////////////////////////////////////////////////
RenderWindow::~RenderWindow() = default;
////////////////////////////////////////////////////////////
Vector2u RenderWindow::getSize() const
{

View File

@ -17,6 +17,7 @@ TEST_CASE("[Graphics] sf::RenderWindow", runDisplayTests())
{
SECTION("Type traits")
{
STATIC_CHECK(std::has_virtual_destructor_v<sf::RenderWindow>);
STATIC_CHECK(!std::is_copy_constructible_v<sf::RenderWindow>);
STATIC_CHECK(!std::is_copy_assignable_v<sf::RenderWindow>);
STATIC_CHECK(!std::is_nothrow_move_constructible_v<sf::RenderWindow>);