diff options
Diffstat (limited to 'gdbsupport')
-rw-r--r-- | gdbsupport/ChangeLog | 6 | ||||
-rw-r--r-- | gdbsupport/gdb_string_view.h | 17 |
2 files changed, 16 insertions, 7 deletions
diff --git a/gdbsupport/ChangeLog b/gdbsupport/ChangeLog index 4db482b..e1b040d 100644 --- a/gdbsupport/ChangeLog +++ b/gdbsupport/ChangeLog @@ -1,3 +1,9 @@ +2020-06-30 Tom Tromey <tromey@adacore.com> + + PR build/26183: + * gdb_string_view.h (basic_string_view::to_string): Remove. + (gdb::to_string): New function. + 2020-06-27 Simon Marchi <simon.marchi@efficios.com> * tdesc.h (class print_xml_feature) <add_line>: Add diff --git a/gdbsupport/gdb_string_view.h b/gdbsupport/gdb_string_view.h index c0ae7a8..65124e6 100644 --- a/gdbsupport/gdb_string_view.h +++ b/gdbsupport/gdb_string_view.h @@ -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 */ |