ICU4C API proposal: change USetElementIterator to return std::u16string

16 views
Skip to first unread message

Markus Scherer

unread,
Dec 13, 2024, 4:19:43 PM12/13/24
to icu-d...@unicode.org
Dear ICU team & users,

I would like to propose the following API for: ICU 77
Please provide feedback by: next Wednesday, 2024-12-18
Designated API reviewer: Robin
Ticket: https://unicode-org.atlassian.net/browse/ICU-22954

In ICU 76, we added C++ header-only APIs. However, as the bug report ticket above shows, we (mostly I) didn't quite get it right, and we didn't have a good way to test these properly. Sorry!

In terms of API, a header-only API cannot use, and especially cannot return, a non-header-only, DLL-exported ICU C++ API.

Therefore, I am proposing that we change the new-in-76 USetElementIterator from returning an icu::UnicodeString to returning a std::u16string.
Since this is the main functionality of that class, I am changing USetElementIterator, USetElements, UnicodeSet::begin(), and UnicodeSet::end() from @draft ICU 76 to @draft ICU 77.

And this time, I figured out a way to change our C++ unit test framework so that we can write tests that do not rely on DLL-exported ICU C++ API -- and moved the USet C++ iterator test code to do so. Now it works, and we can keep it working.

While I was working in this area, I also made LocalPointer and its customizations header-only. The changes there did not involve any publicly visible API changes. We are just making sure to not use the same symbols inside ICU.

Sincerely,
markus

Rich Gillam

unread,
Dec 13, 2024, 9:02:48 PM12/13/24
to Markus Scherer, icu-d...@unicode.org
Markus—

No objections from me…

—Rich

--
You received this message because you are subscribed to the Google Groups "icu-design" group.
To unsubscribe from this group and stop receiving emails from it, send an email to icu-design+...@unicode.org.
To view this discussion visit https://groups.google.com/a/unicode.org/d/msgid/icu-design/CAN49p6rtEOr1qGvLU%2BsuThB3-kAKAHrX1K_0iPhCQDAodkNKuQ%40mail.gmail.com.
For more options, visit https://flagged.apple.com:443/proxy?t2=DS3Y8k4Ue7&o=aHR0cHM6Ly9ncm91cHMuZ29vZ2xlLmNvbS9hL3VuaWNvZGUub3JnL2Qvb3B0b3V0&emid=efa1bad1-4551-40f8-b6ef-6cbcb428f636&c=11.

Markus Scherer

unread,
Dec 23, 2024, 1:47:05 PM12/23/24
to icu-d...@unicode.org
On Fri, Dec 13, 2024 at 1:19 PM Markus Scherer <marku...@gmail.com> wrote:
While I was working in this area, I also made LocalPointer and its customizations header-only. The changes there did not involve any publicly visible API changes. We are just making sure to not use the same symbols inside ICU.

This part did not work, because some DLL-exported ICU classes have LocalPointer members, so LocalPointer needs to be (at least notionally) DLL-exported.
So I am reverting the changes for this part.

Best regards / happy holidays,
markus
Reply all
Reply to author
Forward
0 new messages