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
Родитель 00732bfa12
Коммит c5fea3fa51
1 изменённых файлов: 0 добавлений и 7 удалений

Просмотреть файл

@ -58,13 +58,6 @@ class char16ptr_t {
constexpr operator const void*() const { return mPtr; } constexpr operator const void*() const { return mPtr; }
constexpr explicit operator bool() const { return mPtr != nullptr; } 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 int() const { return reinterpret_cast<intptr_t>(mPtr); }
explicit operator unsigned int() const { explicit operator unsigned int() const {
return reinterpret_cast<uintptr_t>(mPtr); return reinterpret_cast<uintptr_t>(mPtr);