Bug 1353593 - Part 1: Allow implicit conversion of non-const char16ptr_t to wchar*. r=froydnj
☠☠ backed out by 8b11f8753dae ☠ ☠
authorEric Rahm <erahm@mozilla.com>
Fri, 09 Jun 2017 14:50:46 -0700
changeset 411440 4bc441fc5860b4c6ebc22c3d261aa9025dfe15da
parent 411439 7533679209b1d740374dcb3a8a36d1e23de36dff
child 411441 c16b53fc17d9155299c00e49c8287e24c1aeb1bf
push id7391
push usermtabara@mozilla.com
push dateMon, 12 Jun 2017 13:08:53 +0000
treeherdermozilla-beta@2191d7f87e2e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfroydnj
bugs1353593
milestone55.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1353593 - Part 1: Allow implicit conversion of non-const char16ptr_t to wchar*. r=froydnj
mfbt/Char16.h
--- a/mfbt/Char16.h
+++ b/mfbt/Char16.h
@@ -51,16 +51,22 @@ public:
   operator const char16_t*() const
   {
     return mPtr;
   }
   operator const wchar_t*() const
   {
     return reinterpret_cast<const wchar_t*>(mPtr);
   }
+
+  operator wchar_t*()
+  {
+    return const_cast<wchar_t*>(reinterpret_cast<const wchar_t*>(mPtr));
+  }
+
   operator const void*() const
   {
     return mPtr;
   }
   MOZ_IMPLICIT operator bool() const
   {
     return mPtr != nullptr;
   }