Revert "Revert "Prevent nonsensical comparations between OUString and nullptr_t""

This reverts commit e559c0c9cbfd819f22ef695a9823bb71f4385b58; just turn the
deleted overloads into non-friend functions (and rely on any other overloads to
be still found via ADL).

Change-Id: I2af834162cab2e71ed9e32ae6903bc9f86d77ba2
Reviewed-on: https://gerrit.libreoffice.org/30441
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Tested-by: Stephan Bergmann <sbergman@redhat.com>
This commit is contained in:
Stephan Bergmann
2016-10-31 13:38:24 +01:00
parent 4f30849f07
commit 40633e32f3

View File

@@ -3226,6 +3226,18 @@ public:
}
};
#if defined LIBO_INTERNAL_ONLY
// Prevent the operator ==/!= overloads with 'sal_Unicode const *' paramter from
// being selected for nonsensical code like
//
// if (ouIdAttr == nullptr)
//
void operator ==(OUString const &, std::nullptr_t) = delete;
void operator ==(std::nullptr_t, OUString const &) = delete;
void operator !=(OUString const &, std::nullptr_t) = delete;
void operator !=(std::nullptr_t, OUString const &) = delete;
#endif
#if defined LIBO_INTERNAL_ONLY // "RTL_FAST_STRING"
/// @cond INTERNAL