Bug 1766549 - Remove some char16ptr_t operators that allow implicit const-casting. r=nika

Differential Revision: https://phabricator.services.mozilla.com/D144777
This commit is contained in:
Mike Hommey 2022-04-27 22:28:24 +00:00
parent 00732bfa12
commit c5fea3fa51

View File

@ -58,13 +58,6 @@ class char16ptr_t {
constexpr operator const void*() const { return mPtr; }
constexpr explicit operator bool() const { return mPtr != nullptr; }
/* Explicit cast operators to allow things like (char16_t*)str. */
constexpr explicit operator char16_t*() const {
return const_cast<char16_t*>(mPtr);
}
explicit operator wchar_t*() const {
return const_cast<wchar_t*>(static_cast<const wchar_t*>(*this));
}
explicit operator int() const { return reinterpret_cast<intptr_t>(mPtr); }
explicit operator unsigned int() const {
return reinterpret_cast<uintptr_t>(mPtr);