The Use Case
The lesson provides the implementation of a particular use case of std::variant and std::optional
We'll cover the following...
We'll cover the following...
Consider a function that takes the current mouse selection for a game. The function scans the selected range and computes several outputs:
- the number of animating objects
- if there are any civil units in the selection
- if there are any combat units in the selection
The existing code looks like this:
As you can see above, the function uses a lot of output parameters (in the ...