String Conversion Utilities
$ dotnet add package SiddiqSoft.StringHelpers..
.. # import the CPM.cmake module and activate..
..
CPMAddModule("gh:siddiqsoft/StringHelpers#1.0.0")
..
..
target_link_libraries(your-project PRIVATE StringHelpers::StringHelpers)
ConversionUtils (conversion-utils.hpp)
template<typename S, typename D>
auto convert_to<char,wchar_t>(const std::basic_string<T>& src) -> std::basic_string<D>
{
...
return std::basic_string<D>{};
}
convert_to<char,wchar_t>(const std::string& src)
convert_to<wchar_t,char>(const std::wstring& src)
Use this library until C++26 is prevalent and the compiler vendors remove the
codecvtlibrary--not simply deprecation warnings.
© 2024 Siddiq Software LLC. All rights reserved.