I want to iterate over a std::variant
that holds different types of vectors in my case it is std::variant<std::vector<int>, std::vector<double>, std::vector<char>, std::vector<std::string>> entries;
at first I thought I could just use std::vector
‘s methods but that obviously did not work.
the only solution I was able to find was create 4 vectors of all the types and with std::holds_alternative
and and conditions but is there a better way to do it?