зеркало из https://github.com/mozilla/gecko-dev.git
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:
Родитель
00732bfa12
Коммит
c5fea3fa51
|
@ -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);
|
||||||
|
|
Загрузка…
Ссылка в новой задаче