Exception guarantees

Exception guarantees

Exception guarantees, also known as the Abrahams guarantees after David Abrahams who formalized the guidelines [cite web |url=http://www.boost.org/community/exception_safety.html |title=Exception-Safety in Generic Components |accessdate=2008-08-29 ] [cite conference |last=Abrahams |first=David |title=Exception-Safety in Generic Components |booktitle=Generic Programming: Proceedings of a Dagstuhl Seminar |year=1999 |publisher=Springer Verlag ] , are a set of contractual guidelines that class library implementors and clients use when reasoning about exception safety in C++ programs.

The rules apply to class implementations (components) in the presence of exceptions; they are as follows:
* The basic guarantee: that the invariants of the component are preserved, and no resources are leaked.
* 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.
* The no-throw guarantee: that the operation will not throw an exception.

Code that doesn't follow one of the above rules is called "exception unsafe".

References


Wikimedia Foundation. 2010.

Игры ⚽ Нужен реферат?

Look at other dictionaries:

  • Exception handling — is a programming language construct or computer hardware mechanism designed to handle the occurrence of exceptions, special conditions that change the normal flow of program execution. Programming languages differ considerably in their support… …   Wikipedia

  • UNITED STATES OF AMERICA — UNITED STATES OF AMERICA, country in N. America. This article is arranged according to the following outline: introduction Colonial Era, 1654–1776 Early National Period, 1776–1820 German Jewish Period, 1820–1880 East European Jewish Period,… …   Encyclopedia of Judaism

  • France — /frans, frahns/; Fr. /frddahonns/, n. 1. Anatole /ann nann tawl /, (Jacques Anatole Thibault), 1844 1924, French novelist and essayist: Nobel prize 1921. 2. a republic in W Europe. 58,470,421; 212,736 sq. mi. (550,985 sq. km). Cap.: Paris. 3.… …   Universalium

  • international relations — a branch of political science dealing with the relations between nations. [1970 75] * * * Study of the relations of states with each other and with international organizations and certain subnational entities (e.g., bureaucracies and political… …   Universalium

  • Economic Affairs — ▪ 2006 Introduction In 2005 rising U.S. deficits, tight monetary policies, and higher oil prices triggered by hurricane damage in the Gulf of Mexico were moderating influences on the world economy and on U.S. stock markets, but some other… …   Universalium

  • Italy — /it l ee/, n. a republic in S Europe, comprising a peninsula S of the Alps, and Sicily, Sardinia, Elba, and other smaller islands: a kingdom 1870 1946. 57,534,088; 116,294 sq. mi. (301,200 sq. km). Cap.: Rome. Italian, Italia. * * * Italy… …   Universalium

  • Italy — • In ancient times Italy had several other names: it was called Saturnia, in honour of Saturn; Enotria, wine producing land; Ausonia, land of the Ausonians; Hesperia, land to the west (of Greece); Tyrrhenia, etc. The name Italy, which seems to… …   Catholic encyclopedia

  • Europe, history of — Introduction       history of European peoples and cultures from prehistoric times to the present. Europe is a more ambiguous term than most geographic expressions. Its etymology is doubtful, as is the physical extent of the area it designates.… …   Universalium

  • United States — a republic in the N Western Hemisphere comprising 48 conterminous states, the District of Columbia, and Alaska in North America, and Hawaii in the N Pacific. 267,954,767; conterminous United States, 3,022,387 sq. mi. (7,827,982 sq. km); with… …   Universalium

  • United Kingdom — a kingdom in NW Europe, consisting of Great Britain and Northern Ireland: formerly comprising Great Britain and Ireland 1801 1922. 58,610,182; 94,242 sq. mi. (244,100 sq. km). Cap.: London. Abbr.: U.K. Official name, United Kingdom of Great… …   Universalium

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”