确保可拆卸元素,埃菲尔铁塔 [英] Detachable element in ensure, Eiffel

查看:90
本文介绍了确保可拆卸元素,埃菲尔铁塔的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何确保元素在我的HASH_TABLE中,如果它是可分离的?

How can I ensure that an element is in my HASH_TABLE, if it is detachable?

Current = HASH_TABLE[ARRAYED_SET[G], G]

add_edge (src: G; dst: G)
do
    if attached Current.at(src) as edges then
        edges.put(dst)
    end
ensure
    in: Current.at (src).has (dst)
end

推荐答案

您尝试过以下方法:

add_edge (src: G; dst: G)
do
    if attached Current.at(src) as edges then
        edges.put(dst)
    end
ensure
    in: attached Current.at (src) as edges implies edges.has (dst)
end

这篇关于确保可拆卸元素,埃菲尔铁塔的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆