Return owl::tstring or owl::tstring_view for functions currently returning LPCTSTR
Borland's Object Windows Library for the modern age
Brought to you by:
jogybl,
sebas_ledesma
Where returning owl::tstring is not feasible or will be costly, e.g. for returning lookup results in a dictionary of static strings (such as the Windows message names in "eventhan.cpp"), we can now use owl::tstring_view [feature-requests:#127], which is a lightweight pointer and size with a string-like API. It is an alias for std::string_view or std::wstring_view, introduced in C++17.
This will eliminate bugs such as
win.GetCaption() == "MyCaption", which is a pointer comparison, rather than the string comparison that was intended.What do you think? Something to implement in OWLNext 8?
Related
Feature Requests: #127
Last edit: Vidar Hasfjord 2025-03-31
Yes, I think reducing of raw pointers usage makes sense for safety.