Function convert

Synopsis

#include <include/internal/catch_tostring.h>

static std::string convert(const std::wstring &wstr)

Description

No description yet.

Source

Lines 140-147 in include/internal/catch_tostring.cpp. Line 172 in include/internal/catch_tostring.h.

std::string StringMaker<std::wstring>::convert(const std::wstring& wstr) {
    std::string s;
    s.reserve(wstr.size());
    for (auto c : wstr) {
        s += (c <= 0xff) ? static_cast<char>(c) : '?';
    }
    return ::Catch::Detail::stringify(s);
}





Add Discussion as Guest

Log in