18 #ifndef LUNCHBOX_RESULT_H 19 #define LUNCHBOX_RESULT_H 32 typedef void (
Result::*bool_t)()
const;
33 void bool_true()
const {}
35 static const int32_t SUCCESS = 0;
46 operator bool_t()
const 48 return code_ == SUCCESS ? &Result::bool_true : 0;
54 bool operator==(
const int32_t code)
const {
return code_ == code; }
56 bool operator!=(
const int32_t code)
const {
return code != code_; }
62 return code_ == SUCCESS ?
"success" :
"result";
74 #endif // LUNCHBOX_RESULT_H Defines export visibility macros for library Lunchbox.
Basic type definitions not provided by the operating system.
virtual std::string getString() const
bool operator==(const int32_t code) const
A result returns an error code and behaves like a boolean.
Result(const int32_t code)
Construct a new result.
Abstraction layer and common utilities for multi-threaded programming.
std::ostream & operator<<(std::ostream &os, const Array< T > &array)
Pretty-print all members of the array.
virtual ~Result()
Destruct the result.
bool operator!=(const int32_t code) const
This file contains logging classes.