3 ms·
”but I can't figure out how the #define would have been rewritten without changing the signature” It likely is possible in C++, when combined with a generic cl
by Someone 7y ago
”but I can't figure out how the #define would have been rewritten without changing the signature”
It likely is possible in C++, when combined with a generic class that wraps x and defers dereferencing it to the time its copy assignment operator runs.
BAG(x) would return an instance of that class.
For completeness, you also would want an implicit conversion to the type of
**x
in that class, so that
foo(BAG(x)=f(y))
or
while(BAG(x)=f(y))
would continue to work