std::string_view

This commit is contained in:
Jinhao
2018-06-09 01:21:10 +08:00
parent ffee0e5a3b
commit fc7743cbe2
8 changed files with 263 additions and 56 deletions

View File

@@ -168,7 +168,11 @@ namespace detail
{
#if defined(NANA_WINDOWS)
#ifdef _nana_std_has_string_view
auto wstr = to_wstring(std::string_view(text, len));
#else
auto wstr = to_wstring(std::string(text,len));
#endif
::SIZE size;
if (::GetTextExtentPoint32(dw->context, wstr.c_str(), static_cast<int>(wstr.size()), &size))
return nana::size(size.cx, size.cy);