All lightning talks Meeting C++ 2021

preview_player
Показать описание
All lightning talks Meeting C++ 2021
Рекомендации по теме
Комментарии
Автор

Talk 2, Variant string view:
Many years ago (like >20) I had my own universal string interface class specifically for dealing with a proliferation of string types and different character representations. Wide (UTF-16) strings are important on Windows, for calling system API. So we had the std::string/wstring, my own library's string and wstring (reference counted and copy on write, designed for multi-threaded use), COM's bstr wrapper class (wide only IIRC), plain lexical string literals, and MFC's CString class (wide or narrow). Maybe more but those are what I remember.
My solution for passing _any_ of that to a single parameter type was called _ustring_ because it means universal and it matches wstring and later xstring(UTF-32).

It was not a string view in the way of providing the same interface as string. That would not work to change representations (wide/narrow). Instead, the only thing you can do with a ustring is to convert it to some actual string class. Now if you chose the same one that was passed, it just coughs up the original object that was passed, with no copying at all. If it needed a different type, it would construct one and copy or convert as necessary.

It served me very well in the era where programs were supporting both Windows 95 and Windows NT, and would detect whether the Wide version of the specific Windows API being called was available at run-time.

JohnDlugosz
Автор

Squid Game:
Your answers are wrong since some of the actual answers are in lower case and you displayed the choices in all caps.

JohnDlugosz
Автор

Can you pin a comment with links to each talk's resources? It's hard to read the godbolt URL from the first talk in the video.

MatkatMusic
join shbcf.ru