Chris Thrasher
08bfae34e7
Fix build errors when compiling in C++20 mode
...
C++20 removes the ability to stream char32_t characters.
This is the error I get when setting CMAKE_CXX_STANDARD
to 20.
/Users/thrasher/Projects/sfml/test/System/String.test.cpp:32:52: error: overload resolution selected deleted operator '<<'
32 | stream << "[\\x" << std::uppercase << std::hex << character << ']';
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.2.sdk/usr/include/c++/v1/ostream:1009:31: note: candidate function [with _Traits = std::char_traits<char>] has been explicitly deleted
1009 | basic_ostream<char, _Traits>& operator<<(basic_ostream<char, _Traits>&, char32_t) = delete;
| ^
2025-01-20 11:27:43 +00:00
Chris Thrasher
ae87def93e
Use char32_t
for UTF-32 characters
...
This is probably an oversight from https://github.com/SFML/SFML/pull/2480
2024-11-30 18:28:34 -05:00
Chris Thrasher
18eb48b13e
Disallow C-style arrays
2024-10-17 21:40:41 -06:00
Chris Thrasher
27943ea774
Disallow constructing sf::String
from std::nullptr_t
2024-08-30 09:55:55 -06:00
Chris Thrasher
5484824948
Remove unnecessary static casts
2024-06-05 11:54:36 -06:00
Chris Thrasher
9022d9564d
Define character traits for std::uint8_t
...
Character traits are only standardized for character types of which
std::uint8_t is not. All major C++ implementations happen to define
this specialization but because it is not standard C++ they are
allowed to remove it as LLVM has done by deprecating this specialization
in LLVM 18. It is slated for removal in LLVM 19. To avoid compilation
errors and to get ahead of any deprecation warnings when LLVM 18 ships
we need to define our own std::uint8_t character traits.
SFML 4 will have access to C++20's std::u8string which should let us
remove this code.
2024-01-28 10:24:02 -07:00
Chris Thrasher
1e4aed8700
Fix clang-tidy readability-container-size-empty
warnings
2023-09-29 15:55:39 -06:00
Chris Thrasher
98df0fe4c9
Add doc strings to remaining assertions
2023-07-10 15:03:01 -06:00
Chris Thrasher
f6dfc04938
Switch to Catch2
2023-05-13 12:38:11 -06:00
vittorioromeo
cbfa9cbb65
Reorder includes hierarchically
2023-04-25 17:25:33 +02:00
Jan Wojciechowski
692fe84331
Fix condition for trailing bytes count in UTF-8 decoder. Test added to check if a replacement characters is added to output.
2023-04-19 23:52:38 +02:00
vittorioromeo
c6226258db
Improve test utility header compilation speed
2023-04-13 16:33:49 +02:00
Chris Thrasher
f371a99b39
Implement sf::String
in terms of std::u32string
2023-04-04 15:47:34 -06:00
Chris Thrasher
ebe4b3c437
Add tests for sf::String
2023-04-03 21:23:43 -06:00
Jonny Paton
e4bffe5b84
Rename test files to be unique
2022-10-23 16:39:12 +02:00