Using base-n mini lib, you can do the following:
some_data_t in[] { ... };
constexpr int len = sizeof(in)/sizeof(in[0]);
std::string encoded;
bn::encode_b64(in, in + len, std::back_inserter(encoded));
some_data_t out[len];
bn::decode_b64(encoded.begin(), encoded.end(), out);
The API is generic, iterator-based.
Disclosure: I'm the author.