4 ms·
But what if you want to do something apart from rolling with a die?
by lostmsu 7y ago
But what if you want to do something apart from rolling with a die?
- edflsafoiewq 7y agoThen you can create a struct Die and change die to return that. By implementing callAsFunction you keep the same interface as before so existing callers don't break.
- jayd16 7y agoAha ok. This makes far more sense actually. Its a refactor tool for replacing lambdas with callable objects. But does it really work out? Surely you can't put these new structs into the same arrays as similar lambdas, can you?