[libc++] Consistently replace `std::` qualification with `_VSTD::` or nothing. NFCI.
I used a lot of `git grep` to find places where `std::` was being used
outside of comments and assert-messages. There were three outcomes:
- Qualified function calls, e.g. `std::move` becomes `_VSTD::move`.
This is the most common case.
- Typenames that don't need qualification, e.g. `std::allocator` becomes `allocator`.
Leaving these as `_VSTD::allocator` would also be fine, but I decided
that removing the qualification is more consistent with existing practice.
- Names that specifically need un-versioned `std::` qualification,
or that I wasn't sure about. For example, I didn't touch any code in
<atomic>, <math.h>, <new>, or any ext/ or experimental/ headers;
and I didn't touch any instances of `std::type_info`.
In some deduction guides, we were accidentally using `class Alloc = typename std::allocator<T>`,
despite `std::allocator<T>`'s type-ness not being template-dependent.
Because `std::allocator` is a qualified name, this did parse as we intended;
but what we meant was simply `class Alloc = allocator<T>`.
Differential Revision: https://reviews.llvm.org/D92250
GitOrigin-RevId: d586f92c9456a972ee475a021525c0522b89587b
diff --git a/include/filesystem b/include/filesystem
index a39184c..b4a6476 100644
--- a/include/filesystem
+++ b/include/filesystem
@@ -994,8 +994,8 @@
_LIBCPP_INLINE_VISIBILITY operator string_type() const { return __pn_; }
- _LIBCPP_INLINE_VISIBILITY std::string string() const { return __pn_; }
- _LIBCPP_INLINE_VISIBILITY std::string u8string() const { return __pn_; }
+ _LIBCPP_INLINE_VISIBILITY _VSTD::string string() const { return __pn_; }
+ _LIBCPP_INLINE_VISIBILITY _VSTD::string u8string() const { return __pn_; }
#if !defined(_LIBCPP_HAS_NO_LOCALIZATION)
template <class _ECharT, class _Traits = char_traits<_ECharT>,
@@ -1010,20 +1010,20 @@
return __s;
}
- _LIBCPP_INLINE_VISIBILITY std::wstring wstring() const {
+ _LIBCPP_INLINE_VISIBILITY _VSTD::wstring wstring() const {
return string<wchar_t>();
}
- _LIBCPP_INLINE_VISIBILITY std::u16string u16string() const {
+ _LIBCPP_INLINE_VISIBILITY _VSTD::u16string u16string() const {
return string<char16_t>();
}
- _LIBCPP_INLINE_VISIBILITY std::u32string u32string() const {
+ _LIBCPP_INLINE_VISIBILITY _VSTD::u32string u32string() const {
return string<char32_t>();
}
#endif
// generic format observers
- std::string generic_string() const { return __pn_; }
- std::string generic_u8string() const { return __pn_; }
+ _VSTD::string generic_string() const { return __pn_; }
+ _VSTD::string generic_u8string() const { return __pn_; }
#if !defined(_LIBCPP_HAS_NO_LOCALIZATION)
template <class _ECharT, class _Traits = char_traits<_ECharT>,
@@ -1033,9 +1033,9 @@
return string<_ECharT, _Traits, _Allocator>(__a);
}
- std::wstring generic_wstring() const { return string<wchar_t>(); }
- std::u16string generic_u16string() const { return string<char16_t>(); }
- std::u32string generic_u32string() const { return string<char32_t>(); }
+ _VSTD::wstring generic_wstring() const { return string<wchar_t>(); }
+ _VSTD::u16string generic_u16string() const { return string<char16_t>(); }
+ _VSTD::u32string generic_u32string() const { return string<char32_t>(); }
#endif
private:
@@ -1147,7 +1147,7 @@
is_same<_Traits, char_traits<char> >::value,
basic_ostream<_CharT, _Traits>&>::type
operator<<(basic_ostream<_CharT, _Traits>& __os, const path& __p) {
- __os << std::__quoted(__p.native());
+ __os << _VSTD::__quoted(__p.native());
return __os;
}
@@ -1157,7 +1157,7 @@
!is_same<_Traits, char_traits<char> >::value,
basic_ostream<_CharT, _Traits>&>::type
operator<<(basic_ostream<_CharT, _Traits>& __os, const path& __p) {
- __os << std::__quoted(__p.string<_CharT, _Traits>());
+ __os << _VSTD::__quoted(__p.string<_CharT, _Traits>());
return __os;
}
@@ -1249,7 +1249,7 @@
typedef bidirectional_iterator_tag iterator_category;
typedef path value_type;
- typedef std::ptrdiff_t difference_type;
+ typedef ptrdiff_t difference_type;
typedef const path* pointer;
typedef const path& reference;
@@ -1393,7 +1393,7 @@
_LIBCPP_NORETURN inline _LIBCPP_INLINE_VISIBILITY
#ifndef _LIBCPP_NO_EXCEPTIONS
void __throw_filesystem_error(_Args&&... __args) {
- throw filesystem_error(std::forward<_Args>(__args)...);
+ throw filesystem_error(_VSTD::forward<_Args>(__args)...);
}
#else
void __throw_filesystem_error(_Args&&...) {
@@ -2223,7 +2223,7 @@
_LIBCPP_INLINE_VISIBILITY
void __assign_iter_entry(_Path&& __p, __cached_data __dt) {
- __p_ = std::move(__p);
+ __p_ = _VSTD::move(__p);
__data_ = __dt;
}
@@ -2524,10 +2524,10 @@
class recursive_directory_iterator {
public:
using value_type = directory_entry;
- using difference_type = std::ptrdiff_t;
+ using difference_type = ptrdiff_t;
using pointer = directory_entry const*;
using reference = directory_entry const&;
- using iterator_category = std::input_iterator_tag;
+ using iterator_category = input_iterator_tag;
public:
// constructors and destructor