summaryrefslogtreecommitdiffstats
path: root/src/corelib/doc/snippets/code/src_corelib_text_qutf8stringview.cpp
diff options
context:
space:
mode:
authorMårten Nordheim <marten.nordheim@qt.io>2020-09-16 12:04:31 +0200
committerMårten Nordheim <marten.nordheim@qt.io>2020-09-18 23:34:52 +0200
commit107ff4c1d6b5da2cb11c65b2bd9106817f7fdb02 (patch)
treee0c79bac217c10fd6d25fa9c4155f2003f6636df /src/corelib/doc/snippets/code/src_corelib_text_qutf8stringview.cpp
parentbbe7570ddcc6fcce707a355b76d2d0024c44ea38 (diff)
Q(Any|Utf8)StringView: move array size deduction feature to fromArray
The constructor taking an array literal will now stop at the first null-terminator encountered. And fromArray is introduced which only supports array literals. Constructs a view of the full size. Explicit so it shouldn't be surprising. Change-Id: I1497c33a5c12453a95e87c990abe6335b2817081 Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/corelib/doc/snippets/code/src_corelib_text_qutf8stringview.cpp')
-rw-r--r--src/corelib/doc/snippets/code/src_corelib_text_qutf8stringview.cpp5
1 files changed, 0 insertions, 5 deletions
diff --git a/src/corelib/doc/snippets/code/src_corelib_text_qutf8stringview.cpp b/src/corelib/doc/snippets/code/src_corelib_text_qutf8stringview.cpp
index b1033371b1..ba52e2d5c2 100644
--- a/src/corelib/doc/snippets/code/src_corelib_text_qutf8stringview.cpp
+++ b/src/corelib/doc/snippets/code/src_corelib_text_qutf8stringview.cpp
@@ -52,8 +52,3 @@
void myfun1(QUtf8StringView sv); // preferred
void myfun2(const QUtf8StringView &sv); // compiles and works, but slower
//! [0]
-
-//! [2]
- auto sv1 = QUtf8StringView{std::begin(array), std::end(array)}; // using C++11 std::begin()/std::end()
- auto sv2 = QUtf8StringView(array, std::size(array)); // using C++17 std::size()
-//! [2]