How do I pattern match (std::visit) std::array in C++?

In C++, you can use `std::visit` from the `` header to perform pattern matching on `std::array` types. This allows you to apply different operations based on the type contained in the `std::variant`. Here's a brief example to illustrate how to do this effectively.
C++, std::visit, std::array, pattern matching, std::variant, programming
#include <iostream>
#include <variant>
#include <array>
#include <string>

using VariantType = std::variant;

void process(const VariantType& v) {
    std::visit([](auto&& arg) {
        std::cout << "Processing: " << arg << std::endl;
    }, v);
}

int main() {
    std::array data = {1, 3.14, "Hello"};
    
    for (const auto& item : data) {
        process(item);
    }

    return 0;
}

C++ std::visit std::array pattern matching std::variant programming