21 static_assert(
sizeof(
wchar_t) == 2,
"This is Windows, right?");
24 std::wstring
widen(
const std::string&);
31 std::wstring
widen(
const void* src, std::size_t nb);
37 template <
typename T,
typename Alloc = std::allocator<T>>
38 std::wstring
widen(
const std::vector<T, Alloc>& src) {
39 return widen(src.data(), src.size() *
sizeof(T));
43 std::string narrow(
const std::wstring&);
46 std::string narrow(
const std::u16string&);
53 std::string narrow(
const void* src, std::size_t nb);
59 template <
typename T,
typename Alloc = std::allocator<T>>
60 std::string
narrow(
const std::vector<T, Alloc>& src) {
61 return narrow(src.data(), src.size() *
sizeof(T));
std::wstring widen(const std::string &)
std::string narrow(const std::wstring &)