GString.opBinaryRight

A binary operator supporting appending a single character.

  1. typeof(this) opBinaryRight(Grapheme g)
  2. typeof(this) opBinaryRight(R str)
  3. typeof(this) opBinaryRight(C ch)
    struct GString(CharT)
    typeof(this)
    opBinaryRight
    (
    string op : "~"
    C
    )
    (
    C ch
    )
    if (
    isSomeChar!C
    )
    if (
    isSomeChar!CharT
    )

Examples

auto t1 = typeof(this)("Test ");
auto t2 = t1 ~ 'A';
assert(t2.rawString == "Test A");
auto t3 = t1 ~ cast(wchar) 'B';
assert(t3.rawString == "Test B");
auto t4 = t1 ~ cast(dchar) 'C';
assert(t4.rawString == "Test C");
auto t5 = cast(dchar) 'D' ~ t1;
assert(t5.rawString == "DTest ");

Meta