12 static bool by_length(
const std::string &lhs,
const std::string &rhs)
14 if(lhs.size() < rhs.size())
16 if(lhs.size() > rhs.size())
26 std::vector<std::string> output_values;
27 for(
const auto &value :
values)
29 std::ostringstream ss;
30 value->output(ss, ai, ns);
31 output_values.emplace_back(ss.str());
33 std::sort(output_values.begin(), output_values.end(),
by_length);
35 join_strings(out, output_values.begin(), output_values.end(),
", ");
static bool by_length(const std::string &lhs, const std::string &rhs)
an unordered set of value objects
void output(std::ostream &out, const ai_baset &ai, const namespacet &ns) const
This is the basic interface of the abstract interpreter with default implementations of the core func...
A namespacet is essentially one or two symbol tables bound together, to allow for symbol lookups in t...
Stream & join_strings(Stream &&os, const It b, const It e, const Delimiter &delimiter, TransformFunc &&transform_func)
Prints items to an stream, separated by a constant delimiter.