concat

Not really a full-blown library, but more like a gap-filling single header file, José Manuel Barroso Galindo’s fine concat.hpp is the final answer on “how to concatenate template ” elements in a generic way.

Directly from github’s readme.md:

std::vector<int> v{1,2,3,4,5};
std::cout << concat(v) << std::endl;
/* output: "12345" */
 
std::cout << concat(separator(" + "), 1,2,3,4,5) << std::endl;
/* output: "1 + 2 + 3 + 4 + 5" */

Roman’s Rating: 4.7 / 5.0

Information