From 06c5c50537ebf3e9df04a88228746839165108f7 Mon Sep 17 00:00:00 2001 From: Chris Thrasher Date: Tue, 28 Mar 2023 21:27:51 -0600 Subject: [PATCH] De-`constexpr` `sf::String::InvalidPos` This fails to link on MinGW. Until that can be resolved we can go back to a normal constant. Because this is just an integer it doesn't matter all that much whether it's const or constexpr. --- include/SFML/System/String.hpp | 2 +- src/SFML/System/String.cpp | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/include/SFML/System/String.hpp b/include/SFML/System/String.hpp index d13341dd..de753f3f 100644 --- a/include/SFML/System/String.hpp +++ b/include/SFML/System/String.hpp @@ -56,7 +56,7 @@ public: //////////////////////////////////////////////////////////// // NOLINTBEGIN(readability-identifier-naming) /// Represents an invalid position in the string - static constexpr std::size_t InvalidPos{std::basic_string::npos}; + static const std::size_t InvalidPos{std::basic_string::npos}; // NOLINTEND(readability-identifier-naming) //////////////////////////////////////////////////////////// diff --git a/src/SFML/System/String.cpp b/src/SFML/System/String.cpp index 0e44ebc6..64683b10 100644 --- a/src/SFML/System/String.cpp +++ b/src/SFML/System/String.cpp @@ -34,6 +34,10 @@ namespace sf { +//////////////////////////////////////////////////////////// +const std::size_t String::InvalidPos; + + //////////////////////////////////////////////////////////// String::String() = default;