4 Mar
2019
4 Mar
'19
10:11 p.m.
On 4/03/2019 22:53, Niall Douglas wrote:
While I agree that switching to an apparently unrelated state is surprising, it could be anticipated and "solved" by always using monostate as the first type where the types might throw on move. (And perhaps variant could issue a warning or error if you try to do otherwise?)
I'd much prefer that the code not compile instead of unrelated states magically appearing in corner case situations.
Let the user add in monostate to the list of state options if they'd like to explicitly opt into monostate, and only monostate, magically appearing if there is no alternative in the single buffer variant implementation only.
Yes, that's essentially what I was suggesting.