From ad56f130cf30e8940c8012d5c4b2ebce4b5af711 Mon Sep 17 00:00:00 2001 From: Alex Shek Date: Tue, 24 Feb 2026 12:04:59 +0800 Subject: [PATCH 1/4] fix(test/string): avoid use of deleted function MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Remove portion of code to fix a build issue for gcc16(C++23), where the build fails due to test `error: use of deleted function ‘std::basic_ostream& std::operator<<(basic_ostream&, const wchar_t*) [with _Traits = char_traits]’ 148 | DLIB_TEST_MSG( (left_substr(ws,L".") == L"file"), L"");` --- dlib/test/string.cpp | 7 ------- 1 file changed, 7 deletions(-) diff --git a/dlib/test/string.cpp b/dlib/test/string.cpp index 18f9035c5f..2c5948fd6d 100644 --- a/dlib/test/string.cpp +++ b/dlib/test/string.cpp @@ -143,13 +143,6 @@ namespace DLIB_TEST( (left_substr(a,"") == "file.txt")); DLIB_TEST( (right_substr(a,"") == "")); - wstring ws = L"file.txt"; - DLIB_TEST( (left_substr(ws,wstring(L".")) == L"file")); - DLIB_TEST_MSG( (left_substr(ws,L".") == L"file"), L""); - DLIB_TEST( (right_substr(ws,wstring(L".")) == L"txt")); - DLIB_TEST_MSG( (right_substr(ws,L".") == L"txt"), L""); - - dlog << LTRACE << 8; { ostringstream sout; From 8503394561f8689e274892ca795e2e14202b0d05 Mon Sep 17 00:00:00 2001 From: Alex Shek Date: Tue, 24 Feb 2026 14:38:14 +0800 Subject: [PATCH 2/4] fix(test/tokenizer): remove u8"..." MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit C++20 fails due to convert from ‘’ to ‘std::vector >’ --- dlib/test/tokenizer.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dlib/test/tokenizer.cpp b/dlib/test/tokenizer.cpp index f4300666a2..24d24906ea 100644 --- a/dlib/test/tokenizer.cpp +++ b/dlib/test/tokenizer.cpp @@ -394,10 +394,10 @@ namespace deserialize(loaded_test, in_stream); std::vector test_strings = { - u8"This is a test of the tokenisation process...\nimplemented in the Dlib library!", // English - u8"Ceci est un test du processus de\ntokenisation implémenté dans\nla bibliothèque Dlib!", // French - u8"Dette er en test af tokeniseringsprocessen implementeret i Dlib-biblioteket!", // Danish - u8"这是对Dlib库中实现的标记化过程的测试!" // Chinese + "This is a test of the tokenisation process...\nimplemented in the Dlib library!", // English + "Ceci est un test du processus de\ntokenisation implémenté dans\nla bibliothèque Dlib!", // French + "Dette er en test af tokeniseringsprocessen implementeret i Dlib-biblioteket!", // Danish + "这是对Dlib库中实现的标记化过程的测试!" // Chinese }; for (const auto& text : test_strings) { From 115b212f7b6e12915d0cdb0a6dd109b877bccea5 Mon Sep 17 00:00:00 2001 From: Alex Shek Date: Mon, 16 Mar 2026 13:06:15 +0800 Subject: [PATCH 3/4] Revert "fix(test/string): avoid use of deleted function" This reverts commit ad56f130cf30e8940c8012d5c4b2ebce4b5af711. --- dlib/test/string.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/dlib/test/string.cpp b/dlib/test/string.cpp index 2c5948fd6d..18f9035c5f 100644 --- a/dlib/test/string.cpp +++ b/dlib/test/string.cpp @@ -143,6 +143,13 @@ namespace DLIB_TEST( (left_substr(a,"") == "file.txt")); DLIB_TEST( (right_substr(a,"") == "")); + wstring ws = L"file.txt"; + DLIB_TEST( (left_substr(ws,wstring(L".")) == L"file")); + DLIB_TEST_MSG( (left_substr(ws,L".") == L"file"), L""); + DLIB_TEST( (right_substr(ws,wstring(L".")) == L"txt")); + DLIB_TEST_MSG( (right_substr(ws,L".") == L"txt"), L""); + + dlog << LTRACE << 8; { ostringstream sout; From 76f136191f5a4194a9d8d841ff1a9bf70c582415 Mon Sep 17 00:00:00 2001 From: Alex Shek Date: Mon, 16 Mar 2026 13:07:42 +0800 Subject: [PATCH 4/4] fix(test/string): Attempt fix again without deleting the test --- dlib/test/string.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dlib/test/string.cpp b/dlib/test/string.cpp index 18f9035c5f..09ac3e304b 100644 --- a/dlib/test/string.cpp +++ b/dlib/test/string.cpp @@ -145,9 +145,9 @@ namespace wstring ws = L"file.txt"; DLIB_TEST( (left_substr(ws,wstring(L".")) == L"file")); - DLIB_TEST_MSG( (left_substr(ws,L".") == L"file"), L""); + DLIB_TEST_MSG( (left_substr(ws,L".") == L"file"), ""); DLIB_TEST( (right_substr(ws,wstring(L".")) == L"txt")); - DLIB_TEST_MSG( (right_substr(ws,L".") == L"txt"), L""); + DLIB_TEST_MSG( (right_substr(ws,L".") == L"txt"), ""); dlog << LTRACE << 8;