STIR  6.2.0
Public Types | Public Member Functions | List of all members
stir::Succeeded Class Reference

a class containing an enumeration type that can be used by functions to signal successful operation or not More...

#include "stir/Succeeded.h"

Public Types

enum  value { yes, no }
 

Public Member Functions

 Succeeded (const value &v=yes)
 
bool operator== (const Succeeded &v2) const
 
bool operator!= (const Succeeded &v2) const
 
bool succeeded () const
 convenience function returns if it is equal to Succeeded::yes
 

Detailed Description

a class containing an enumeration type that can be used by functions to signal successful operation or not

Example:

Succeeded f() { do_something; return Succeeded::yes; }
void g() { if (f() == Succeeded::no) error("Error calling f"); }
// the latter can also be written as
void g2() { if (!f().succeeded()) error("Error calling f"); }

The documentation for this class was generated from the following file: