| 28 | |
| 29 | |
| 30 | void msvc_only() |
| 31 | { |
| 32 | |
| 33 | #if BOOST_PARSER_DETAIL_TEXT_USE_CONCEPTS && defined(_MSC_VER) |
| 34 | #include <algorithm> |
| 35 | |
| 36 | // msvc string_view |
| 37 | { |
| 38 | std::string_view sv = "text"; |
| 39 | std::wstring_view wsv = L"text"; |
| 40 | |
| 41 | { |
| 42 | auto r = detail::text::as_utf8(sv); |
| 43 | std::string str = " "; |
| 44 | std::ranges::copy(r, str.begin()); |
| 45 | BOOST_TEST(str == sv); |
| 46 | } |
| 47 | { |
| 48 | auto r = detail::text::as_utf8(wsv); |
| 49 | std::wstring wstr = L" "; |
| 50 | std::ranges::copy(r, wstr.begin()); |
| 51 | BOOST_TEST(wstr == wsv); |
| 52 | } |
| 53 | { |
| 54 | auto r = sv | detail::text::as_utf8; |
| 55 | std::string str = " "; |
| 56 | std::ranges::copy(r, str.begin()); |
| 57 | BOOST_TEST(str == sv); |
| 58 | } |
| 59 | { |
| 60 | auto r = wsv | detail::text::as_utf8; |
| 61 | std::wstring wstr = L" "; |
| 62 | std::ranges::copy(r, wstr.begin()); |
| 63 | BOOST_TEST(wstr == wsv); |
| 64 | } |
| 65 | |
| 66 | { |
| 67 | auto r = detail::text::as_utf16(sv); |
| 68 | std::string str = " "; |
| 69 | std::ranges::copy(r, str.begin()); |
| 70 | BOOST_TEST(str == sv); |
| 71 | } |
| 72 | { |
| 73 | auto r = detail::text::as_utf16(wsv); |
| 74 | std::wstring wstr = L" "; |
| 75 | std::ranges::copy(r, wstr.begin()); |
| 76 | BOOST_TEST(wstr == wsv); |
| 77 | } |
| 78 | { |
| 79 | auto r = sv | detail::text::as_utf16; |
| 80 | std::string str = " "; |
| 81 | std::ranges::copy(r, str.begin()); |
| 82 | BOOST_TEST(str == sv); |
| 83 | } |
| 84 | { |
| 85 | auto r = wsv | detail::text::as_utf16; |
| 86 | std::wstring wstr = L" "; |
| 87 | std::ranges::copy(r, wstr.begin()); |