On Friday, 15 March 2019 at 21:35:12 UTC, eXodiquas wrote:
Is there any way to achive this behaivour with D2?
Yep. Just make the return type in the function declaration `auto`. You are then free to return a different type in each static branch.
Sebastiaan Koppe via Digitalmars-d-learn Fri, 15 Mar 2019 14:46:11 -0700
On Friday, 15 March 2019 at 21:35:12 UTC, eXodiquas wrote:
Is there any way to achive this behaivour with D2?
Yep. Just make the return type in the function declaration `auto`. You are then free to return a different type in each static branch.