digitalmars.D.learn - How do I pass a template type as parameter?
- Machine Code (4/4) Apr 16 2019 I've tried those syntaxes:
- Adam D. Ruppe (6/7) Apr 16 2019 appender isn't a type, it is a helper function that returns a
- Machine Code (2/9) Apr 16 2019 I see. Thank you!
I've tried those syntaxes: void f(appender!string buffer) { } void f(A = appender)(A!string buffer) { } but no luck... how do I do that?
Apr 16 2019
On Tuesday, 16 April 2019 at 21:07:51 UTC, Machine Code wrote:void f(appender!string buffer) { }appender isn't a type, it is a helper function that returns a type called Appender: http://dpldocs.info/experimental-docs/std.array.appender.1.html http://dpldocs.info/experimental-docs/std.array.Appender.html So try like `void f(Appender!string buffer) {}`
Apr 16 2019
On Tuesday, 16 April 2019 at 21:24:54 UTC, Adam D. Ruppe wrote:On Tuesday, 16 April 2019 at 21:07:51 UTC, Machine Code wrote:I see. Thank you!void f(appender!string buffer) { }appender isn't a type, it is a helper function that returns a type called Appender: http://dpldocs.info/experimental-docs/std.array.appender.1.html http://dpldocs.info/experimental-docs/std.array.Appender.html So try like `void f(Appender!string buffer) {}`
Apr 16 2019