On Fri, Mar 1, 2019 at 5:50 PM Robert Ramey via Boost < boost@lists.boost.org>
So as an exercise, you might experiment with your own use case regarding strings.
I am not that interested in this since I know https://news.ycombinator.com/item?id=13050980 it will be slow, but if you want to see a library that does that https://github.com/arximboldi/immer There is also a boostcon talk. I don't claim that variant with assignment is not
useful/necessary. I'm really suggesting that perhaps might be interesting to consider a variant of variant (const variant?) which didn't assignment. The only problem with this is that implementation is so trivial that perhaps a library is not appropriate other than as a tool to motivate people to think about how they are using the variant in the first place.
I like const generally, but sometimes mutable variant is great. For example if you model a state of your object with it, so it has either ConnectedData, DisconnectedData or ConnectingData structs as type. Then you do state transitions by doing variant assignment. Long story short is that generally people use mutability too much, but sometimes they actually need it. regards, IVan