C++.Coding.Standards.1918.Rules.Guidelines [Electronic resources]

Herb Sutter, Andrei Alexandrescu

نسخه متنی -صفحه : 521/ 361
نمايش فراداده

Summary

A breach of contract is an error: A function is a unit of work. Thus, failures should be viewed as errors or otherwise based on their impact on functions. Within a function

f , a failure is an error if and only if it violates one of

f 's preconditions or prevents

f from meeting any of its callees' preconditions, achieving any of

f 's own postconditions, or reestablishing any invariant that

f shares responsibility for maintaining.Item 68).