diff --git a/string/public/nsAReadableString.h b/string/public/nsAReadableString.h index d11b375ec031..3c071f4dc84f 100644 --- a/string/public/nsAReadableString.h +++ b/string/public/nsAReadableString.h @@ -779,7 +779,7 @@ class basic_nsLiteralString public: - // Note: _not_ explicit + explicit basic_nsLiteralString( const CharT* aLiteral ) : mStart(aLiteral), mEnd(mStart ? (mStart + nsCharTraits::length(mStart)) : mStart) @@ -903,6 +903,7 @@ class basic_nsLiteralChar public: + explicit basic_nsLiteralChar( CharT aChar ) : mChar(aChar) { @@ -1363,7 +1364,7 @@ Compare( const CharT* lhs, const basic_nsAReadableString& rhs ) template inline nsPromiseConcatenation -operator+( const nsPromiseConcatenation& lhs, const basic_nsAReadableString& rhs ) +Concat( const nsPromiseConcatenation& lhs, const basic_nsAReadableString& rhs ) { return nsPromiseConcatenation(lhs, rhs, lhs.GetFragmentIdentifierMask()<<1); } @@ -1371,11 +1372,27 @@ operator+( const nsPromiseConcatenation& lhs, const basic_nsAReadableStri template inline nsPromiseConcatenation -operator+( const basic_nsAReadableString& lhs, const basic_nsAReadableString& rhs ) +Concat( const basic_nsAReadableString& lhs, const basic_nsAReadableString& rhs ) { return nsPromiseConcatenation(lhs, rhs); } +template +inline +nsPromiseConcatenation +operator+( const nsPromiseConcatenation& lhs, const basic_nsAReadableString& rhs ) + { + return Concat(lhs, rhs); + } + +template +inline +nsPromiseConcatenation +operator+( const basic_nsAReadableString& lhs, const basic_nsAReadableString& rhs ) + { + return Concat(lhs, rhs); + } + #ifdef NEED_CPP_DERIVED_TEMPLATE_OPERATORS diff --git a/xpcom/ds/nsAReadableString.h b/xpcom/ds/nsAReadableString.h index d11b375ec031..3c071f4dc84f 100644 --- a/xpcom/ds/nsAReadableString.h +++ b/xpcom/ds/nsAReadableString.h @@ -779,7 +779,7 @@ class basic_nsLiteralString public: - // Note: _not_ explicit + explicit basic_nsLiteralString( const CharT* aLiteral ) : mStart(aLiteral), mEnd(mStart ? (mStart + nsCharTraits::length(mStart)) : mStart) @@ -903,6 +903,7 @@ class basic_nsLiteralChar public: + explicit basic_nsLiteralChar( CharT aChar ) : mChar(aChar) { @@ -1363,7 +1364,7 @@ Compare( const CharT* lhs, const basic_nsAReadableString& rhs ) template inline nsPromiseConcatenation -operator+( const nsPromiseConcatenation& lhs, const basic_nsAReadableString& rhs ) +Concat( const nsPromiseConcatenation& lhs, const basic_nsAReadableString& rhs ) { return nsPromiseConcatenation(lhs, rhs, lhs.GetFragmentIdentifierMask()<<1); } @@ -1371,11 +1372,27 @@ operator+( const nsPromiseConcatenation& lhs, const basic_nsAReadableStri template inline nsPromiseConcatenation -operator+( const basic_nsAReadableString& lhs, const basic_nsAReadableString& rhs ) +Concat( const basic_nsAReadableString& lhs, const basic_nsAReadableString& rhs ) { return nsPromiseConcatenation(lhs, rhs); } +template +inline +nsPromiseConcatenation +operator+( const nsPromiseConcatenation& lhs, const basic_nsAReadableString& rhs ) + { + return Concat(lhs, rhs); + } + +template +inline +nsPromiseConcatenation +operator+( const basic_nsAReadableString& lhs, const basic_nsAReadableString& rhs ) + { + return Concat(lhs, rhs); + } + #ifdef NEED_CPP_DERIVED_TEMPLATE_OPERATORS diff --git a/xpcom/string/public/nsAReadableString.h b/xpcom/string/public/nsAReadableString.h index d11b375ec031..3c071f4dc84f 100644 --- a/xpcom/string/public/nsAReadableString.h +++ b/xpcom/string/public/nsAReadableString.h @@ -779,7 +779,7 @@ class basic_nsLiteralString public: - // Note: _not_ explicit + explicit basic_nsLiteralString( const CharT* aLiteral ) : mStart(aLiteral), mEnd(mStart ? (mStart + nsCharTraits::length(mStart)) : mStart) @@ -903,6 +903,7 @@ class basic_nsLiteralChar public: + explicit basic_nsLiteralChar( CharT aChar ) : mChar(aChar) { @@ -1363,7 +1364,7 @@ Compare( const CharT* lhs, const basic_nsAReadableString& rhs ) template inline nsPromiseConcatenation -operator+( const nsPromiseConcatenation& lhs, const basic_nsAReadableString& rhs ) +Concat( const nsPromiseConcatenation& lhs, const basic_nsAReadableString& rhs ) { return nsPromiseConcatenation(lhs, rhs, lhs.GetFragmentIdentifierMask()<<1); } @@ -1371,11 +1372,27 @@ operator+( const nsPromiseConcatenation& lhs, const basic_nsAReadableStri template inline nsPromiseConcatenation -operator+( const basic_nsAReadableString& lhs, const basic_nsAReadableString& rhs ) +Concat( const basic_nsAReadableString& lhs, const basic_nsAReadableString& rhs ) { return nsPromiseConcatenation(lhs, rhs); } +template +inline +nsPromiseConcatenation +operator+( const nsPromiseConcatenation& lhs, const basic_nsAReadableString& rhs ) + { + return Concat(lhs, rhs); + } + +template +inline +nsPromiseConcatenation +operator+( const basic_nsAReadableString& lhs, const basic_nsAReadableString& rhs ) + { + return Concat(lhs, rhs); + } + #ifdef NEED_CPP_DERIVED_TEMPLATE_OPERATORS