static json_type type(const value_type& x) {
        const std::type_info& type(x.type_info());

        if (type == typeid(object_type)) return json_type::object;
        else if (type == typeid(array_type)) return json_type::array;
        else if (type == typeid(string_type)) return json_type::string;
        else if (type == typeid(double)) return json_type::number;
        else if (type == typeid(bool)) return json_type::boolean;
        else if (type == typeid(adobe::empty_t)) return json_type::null;

        ADOBE_ASSERT(false && "invalid type for serialization");
    }