areg-sdk
areg-sdk copied to clipboard
[c++17] use std::string
- Replace String
- Replace WideString
we merge issues #16 , #17 and #18 to the https://github.com/aregtech/areg-sdk/tree/20220206-stl17-migration
Good day, @biwiki. Can you please inform whether this ticket is completed or there are still things to do? I am completing the other container migration an would like to start preparing merging with master. Thank you!
Sorry to say it is still far away from completion, there are lot of things to be done since String is used heavily in the library core
Hi @biwiki . Thank you for your reply. It's OK, i just wanted to know whether i need to refactor String class or not. On the first step, i'll refactor class String
, on second step String
with std::string
(you were replacing, right?).
I think I chose to follow the other direction by replacing String with std::string, and deprecating String at the end. And I had also been using other C++17 features along the way, so perhaps it might not be good to merge to master
At the begin I also tried to do so for containers. For example, tried completely replace TEArrayList
with std::vector
. It took me very long time and at the end end-up with some mess 😁 There were several problems that needed to fix in parallel. Then i decided to overwrite TEArrayList
to keep API maximum close. It worked much better. Did same with other containers. After this refactoring, i have compatibility of containers, but not really the API:
-
TEArrayList
-->std::vector
-
TEHashMap
-->std::unordered_map
-
TEStack
-->std::deque
-
TELinkedList
-->std::list
Changes are in 20220528-adapt-stl
Same I'll do with the String
. Then I'll try wherever is possible to use STL objects.
As always, your suggestions / comments are welcomed
Instead of replacing String
or const char *
with std::string
, implemented String
as a wrapper of std::string
.
All fixes are in 20220701-candidate.
Closing the ticket as fixed.