11 char[] buf; put(w, buf);
15 public bool opEquals(T)(T other) const
16 // Add const, different from bug 10056
18 alias Foo!(typeof(this), T, "CMP") P;
23 template Foo(T, U, string OP)
25 static if (T.ISEMPTY && U.ISEMPTY)
33 /**********************************************/
35 void put(R, E)(ref R r, E e)
37 static if (is(typeof(r.put(e))))
43 static assert(false, "Cannot put a "~E.stringof~" into a "~R.stringof);
47 struct Appender(A : T[], T)
49 private template canPutItem(U)
51 enum bool canPutItem = is(U : T);
53 private template canPutRange(R)
55 enum bool canPutRange = is(typeof(Appender.init.put(R.init[0])));
58 void put(U)(U item) if (canPutItem!U)
60 char[T.sizeof == 1 ? 4 : 2] encoded;
63 void put(R)(R items) if (canPutRange!R)