I am trying to use {fmt} to print a std::vector or std::array like this:
std::vector<double> vec = {1., 2., 3.};
fmt::print("{:0.3f}\n", fmt::join(vec, ","));
Thing is, I hope to print a transformed vector:
std::vector<double> vec = {1., 2., 3.};
std::vector<double> vec_dup;
std::transform(vec.begin(), vec.end(), std::back_inserter(vec_dup), [](auto x){return x * M_PI;});
fmt::print("{:0.3f}\n", fmt::join(vec_dup, ","));
Is there a way to do this in C++17 without the need to create a new container?