Do not define basic_string_view::to_string
[deliverable/binutils-gdb.git] / gdbsupport / gdb_string_view.h
index c0ae7a8a2d9d4245bd3b72415aa3d20968f3adc4..65124e67e5428ad517c4b8337f99c79bd7b8d5a5 100644 (file)
@@ -245,13 +245,6 @@ namespace gdb {
          return { this->_M_str, this->_M_len };
        }
 
-      template<typename _Allocator = std::allocator<_CharT>>
-       std::basic_string<_CharT, _Traits, _Allocator>
-       to_string(const _Allocator& __alloc = _Allocator()) const
-       {
-         return { this->_M_str, this->_M_len, __alloc };
-       }
-
       size_type
       copy(_CharT* __str, size_type __n, size_type __pos = 0) const
       {
@@ -560,4 +553,14 @@ namespace gdb {
 
 #endif // __cplusplus < 201703L
 
+namespace gdb {
+
+static inline std::string
+to_string(const gdb::string_view &view)
+{
+  return { view.data (), view.size () };
+}
+
+}
+
 #endif /* COMMON_GDB_STRING_VIEW_H */
This page took 0.023163 seconds and 4 git commands to generate.