Implement a macro that does the following automatically:
function myfun!(out1, out2, args...)
# do some stuff
return out1, out2
end
function whatalloc(::typeof(myfun!), args...)
# ... cf docs
return alc1, alc2
end
# generate the following function with a macro:
function myfun(args...)
alc1, alc2 = whatalloc(myfun!, args...)
out1 = zeros(alc1...)
out2 = zeros(alc2...)
return myfun!(out1, out2, args...)
end
Implement a macro that does the following automatically: