Imported Upstream version 17.25.4
[platform/upstream/libzypp.git] / zypp / IdString.h
index 07a0da3..113bb92 100644 (file)
@@ -14,6 +14,7 @@
 
 #include <iosfwd>
 #include <string>
+#include <string_view>
 
 #include <boost/utility/string_ref_fwd.hpp>
 
@@ -62,6 +63,12 @@ namespace zypp
       /** Ctor from boost::string_ref. */
       explicit IdString( boost::string_ref str_r );
 
+#ifdef __cpp_lib_string_view
+      explicit IdString( std::string_view str_r )
+      : IdString( str_r.data(), str_r.size() )
+      {}
+#endif
+
     public:
       /** No or Null string ( Id \c 0 ). */
       static const IdString Null;