术语“异常强”和“异常中性”意思? [英] What the terms "exception strong" and "exception neutral" mean?

查看:199
本文介绍了术语“异常强”和“异常中性”意思?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我认为 exception strong 意味着程序可以成功结束,或者如果它没有成功结束,它将保留数据不变,但我不知道什么异常中立表示。有人可以定义这两个术语吗?

I think exception strong means that the program either ends successfully or if it doesn't ends successfully it leaves the data unchanged, but I am not sure what exception neutral means. Can someone define these two terms?

推荐答案

常规组件中的异常安全


强有力的保证:操作已成功完成或抛出异常,使程序状态与操作开始之前完全一致。

The strong guarantee: that the operation has either completed successfully or thrown an exception, leaving the program state exactly as it was before the operation started.



and


在一个通用组件中,我们通常会有一个额外的异常中立期望,这意味着应该传播一个组件的类型参数抛出的异常,不变,对组件的呼叫者。

In a generic component, we usually have an additional expectation of exception-neutrality, which means that exceptions thrown by a component's type parameters should be propagated, unchanged, to the component's caller.

这篇关于术语“异常强”和“异常中性”意思?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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