On Tuesday, 12 January 2021 at 21:32:14 UTC, Ali Çehreli wrote:
On 1/12/21 12:58 PM, cc wrote:
> void send(T query, void delegate(T.RESPONSE) callback) {
That wants a delegate that takes a T.RESPONSE (PingResponse in
this case). However, the following lambda is in fact a template:
>
On 1/12/21 12:58 PM, cc wrote:
> void send(T query, void delegate(T.RESPONSE) callback) {
That wants a delegate that takes a T.RESPONSE (PingResponse in this
case). However, the following lambda is in fact a template:
> send(PingQuery("helo"), (resp) {
You specify the type there an
Given the following program:
struct PingQuery {
string msg;
}
struct PingResponse {
string msg;
}
template send(T) {
void send(T query, void delegate(PingResponse) callback) {
writefln("Sending: %s", query);
if (callback) {