C/C++
errorcd.txt
Associated article: Mandatory Error Codes Revisited
Tags: C/C++ Open Source Embedded Systems
Published source code accompanying the article by Guy Peleg in which he examines mandatory error codes which force callers of a method to accept and use the returned error code.
Mandatory Error Code Revisited
by Guy Peleg
Example 1: Using the framework.
ErrorCode<int> FallableFunction(); // function declaration
ErrorCode<int> result = FallableFunction(); // ok
if (FallableFunction ()) {...} // ok
FallableFunction(); // will throw
(IgnoreError) FallableFunction(); // ok
Example 2: Problem code.
void AClass::someMethod()
{
...


