如果元素可以拆卸,我如何确保元素在我的HASH_TABLE中?
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
答案 0 :(得分:1)
你试过吗:
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