I do not know Java very well, but from the article I got the impression that in Java you could use List<?> as a reference in non-generic code to a List of arbitrary type. I.e. you could assign:
List<?> variable = new ArrayList<Integer>();
That is not possible with std::vector<std::any>> in C++ without converting and allocating a new vector. I am not familiar enough with the C++ standard to say it definitively but similar rules apply for vectors of pointers see https://godbolt.org/z/no3r67P5z