Generating default value when none is found
问题 I have an input vector that can have any size between empty and 3 elements. I want the generated string to always be 3 floats separated by spaces, where a default value is used if there aren't enough elements in the vector. So far I've managed to output only the contents of the vector: #include <iostream> #include <iterator> #include <vector> #include "boost/spirit/include/karma.hpp" namespace karma = boost::spirit::karma; namespace phx = boost::phoenix; typedef std::back_insert_iterator<std: