Todos os livros

Profissional

Apps Sobre Coach Entrar Começar a ler

Computer Science · Glossário

O que é Exception-safety guarantees?

Também chamado de: exception-safety guarantee

Definition 1.16 University Computer Science — Year 2 · Capítulo 1 — From C to C++: Classes and Resource Management

An operation gives the basic guarantee if, when it throws, no resource is leaked and every object it touched still satisfies its invariant, though its value may have changed. It gives the strong guarantee if, when it throws, the state is exactly as before the call (“commit or roll back”). It gives the no-throw guarantee if it never throws; a function declares it with noexcept.

The roster of  before the call and after a call throws on the empty name. The basic guarantee leaves some valid state, here with Cora and Dev added; the strong guarantee leaves the state of before.
The roster of Listing 1.11 before the call and after a call throws on the empty name. The basic guarantee leaves some valid state, here with Cora and Dev added; the strong guarantee leaves the state of before.
Ler no capítulo →