BasicString.opBinaryRight - multiple declarations

Function BasicString.opBinaryRight

Returns a newly constructed BasicString object with its value being the concatenation of the characters in lhs followed by those of this.

typeof(this) opBinaryRight(string op) (
  scope const BasicString.CharType[] lhs
) scope
if (op == "+" || op == "~");

typeof(this) opBinaryRight(string op, Lhs) (
  auto scope const ref Lhs lhs
) scope
if ((op == "+" || op == "~") && (isSomeChar!Lhs || isSomeString!Lhs || isCharArray!Lhs || isIntegral!Lhs));

Parameter lhs can by type of BasicString!(...), char|wchar|dchar array/slice/character.

Examples

BasicString!char str = null;
assert(str.empty);

str = '1' + str;
assert(str == "1");

str = "32"d + str;
assert(str == "321");

str = BasicString!dchar("654") + str;
assert(str == "654321");

Function BasicString.opBinaryRight

Operator in

bool opBinaryRight(string op, Elm) (
  auto scope ref Elm elm
) const scope
if (op == "in");

Examples

BasicString!char str = "a123読";

assert('a' in str);
assert('b' !in str);
assert('3' in str);
assert('読' in str);