summaryrefslogtreecommitdiff
path: root/tools/quickbook/src/string_view.hpp
diff options
context:
space:
mode:
authorDongHun Kwak <dh0128.kwak@samsung.com>2017-09-13 11:08:07 +0900
committerDongHun Kwak <dh0128.kwak@samsung.com>2017-09-13 11:09:00 +0900
commitb5c87084afaef42b2d058f68091be31988a6a874 (patch)
treeadef9a65870a41181687e11d57fdf98e7629de3c /tools/quickbook/src/string_view.hpp
parent34bd32e225e2a8a94104489b31c42e5801cc1f4a (diff)
downloadboost-b5c87084afaef42b2d058f68091be31988a6a874.tar.gz
boost-b5c87084afaef42b2d058f68091be31988a6a874.tar.bz2
boost-b5c87084afaef42b2d058f68091be31988a6a874.zip
Imported Upstream version 1.64.0upstream/1.64.0
Change-Id: Id9212edd016dd55f21172c427aa7894d1d24148b Signed-off-by: DongHun Kwak <dh0128.kwak@samsung.com>
Diffstat (limited to 'tools/quickbook/src/string_view.hpp')
-rw-r--r--tools/quickbook/src/string_view.hpp30
1 files changed, 30 insertions, 0 deletions
diff --git a/tools/quickbook/src/string_view.hpp b/tools/quickbook/src/string_view.hpp
new file mode 100644
index 0000000000..3f28b3e98e
--- /dev/null
+++ b/tools/quickbook/src/string_view.hpp
@@ -0,0 +1,30 @@
+/*=============================================================================
+ Copyright (c) 2017 Daniel James
+ http://spirit.sourceforge.net/
+
+ Use, modification and distribution is subject to the Boost Software
+ License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+ http://www.boost.org/LICENSE_1_0.txt)
+=============================================================================*/
+#if !defined(BOOST_SPIRIT_QUICKBOOK_STRING_VIEW_HPP)
+#define BOOST_SPIRIT_QUICKBOOK_STRING_VIEW_HPP
+
+#include <boost/utility/string_view.hpp>
+
+namespace quickbook {
+ // boost::string_view now can't be constructed from an rvalue std::string,
+ // which is something that quickbook does in several places, so this wraps
+ // it to allow that.
+
+ struct string_view : boost::string_view {
+ typedef boost::string_view base;
+
+ string_view() : base() {}
+ string_view(string_view const& x) : base(x) {}
+ string_view(std::string const& x) : base(x) {}
+ string_view(const char* x) : base(x) {}
+ string_view(const char* x, typename base::size_type len) : base(x, len) {}
+ };
+}
+
+#endif