示例#1
0
    void
    operator()(const dynamic_t::array_t& v) const {
        std::cout << "[" << std::endl;

        bool print_coma = false;
        for(size_t i = 0; i < v.size(); ++i) {
            if (print_coma) {
                std::cout << "," << std::endl;
            }
            std::cout << std::string(2 * (m_indent + 1), ' ');
            v[i].apply(print_visitor(m_indent + 1));
            print_coma = true;
        }

        std::cout << std::endl << std::string(2 * m_indent, ' ') << "]";
    }
示例#2
0
    std::string
    operator()(const dynamic_t::array_t& v) const {
        std::string result = "[";

        size_t index = 0;

        if(!v.empty()) {
            result += v[index++].apply(*this);
        }

        while(index < v.size()) {
            result += ", ";
            result += v[index++].apply(*this);
        }

        return result + "]";
    }