Hi,
I have got the following code:
function GasCost(string memory name,
function () internal returns (string memory) fun)
internal returns (string memory)
{
uint u0 = gasleft();
string memory sm = fun();
uint u1 = gasleft();
uint diff = u0 - u1;
return concat(name, " GasCost: ", stringOfUint(diff),
" returns(", sm, ")");
}
Somebody please explain me what is the name of the above function defining technique? and how to invoke such functions? Provide me the link for the tutorial also.
Zulfi.