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