Add the deleted string_view(std::nullptr_t) constructor from C++23

This will reject string_view(nullptr) at compile-time.

PiperOrigin-RevId: 835352115
Change-Id: Ic68e55d3eba02e002ed5f1791c40efbb0f0daaf0
This commit is contained in:
Derek Mauro
2025-11-21 14:05:50 -08:00
committed by Copybara-Service
parent 8036cae8ac
commit 69e7e0a383

View File

@@ -246,6 +246,9 @@ class ABSL_ATTRIBUTE_VIEW string_view {
}
#endif // ABSL_INTERNAL_CPLUSPLUS_LANG >= 202002L
// Deleted constructor from std::nullptr_t from C++23.
string_view(std::nullptr_t) = delete;
constexpr string_view(const string_view&) noexcept = default;
string_view& operator=(const string_view&) noexcept = default;