1. 4
  1.  

  2. 1

    std::any is one of those things that simultaneously seems like an abomination and also brilliant. At least the article advises using std::variant where possible, although I’ll point out that the memory use characteristics of the two are very different, so it’s not just a question of whether you’re storing values from a bounded or unbounded set of types.