mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-10 03:45:46 +00:00
Bug 1344629 - Part 6.5: Allow get() on nsLiteralStrings, excluding temporaries. r=dbaron
This prevents the antipattern found in bug 1341513. MozReview-Commit-ID: JhxgC7aQDUA --HG-- extra : rebase_source : b1ff0d240df87b2cbb415183dc93acc8bde7960a
This commit is contained in:
parent
40f4821701
commit
9236e31186
@ -33,6 +33,21 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Prohibit get() on temporaries as in nsLiteralCString("x").get().
|
||||
* These should be written as just "x", using a string literal directly.
|
||||
*/
|
||||
#if defined(CharT_is_PRUnichar) && defined(MOZ_USE_CHAR16_WRAPPER)
|
||||
char16ptr_t get() const && = delete;
|
||||
char16ptr_t get() const &
|
||||
#else
|
||||
const char_type* get() const && = delete;
|
||||
const char_type* get() const &
|
||||
#endif
|
||||
{
|
||||
return mData;
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
// NOT TO BE IMPLEMENTED
|
||||
|
Loading…
Reference in New Issue
Block a user