summaryrefslogtreecommitdiff
path: root/sql/string_view.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/string_view.cc')
-rw-r--r--sql/string_view.cc25
1 files changed, 25 insertions, 0 deletions
diff --git a/sql/string_view.cc b/sql/string_view.cc
new file mode 100644
index 00000000000..6b3b101c131
--- /dev/null
+++ b/sql/string_view.cc
@@ -0,0 +1,25 @@
+/*****************************************************************************
+Copyright (c) 2021 MariaDB Corporation.
+This program is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free Software
+Foundation; version 2 of the License.
+This program is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+You should have received a copy of the GNU General Public License along with
+this program; if not, write to the Free Software Foundation, Inc.,
+51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+*****************************************************************************/
+
+#include "string_view.h"
+
+#include <ostream>
+
+std::basic_ostream<char> &operator<<(std::basic_ostream<char> &os,
+ string_view v)
+{
+ // TODO standard requires a much more complicated code here.
+ auto size= static_cast<std::streamsize>(v.size());
+ os.write(v.data(), size);
+ return os;
+}