21#ifndef JKQTPEXPECTED_H_INCLUDED
22#define JKQTPEXPECTED_H_INCLUDED
38#define JKQTPUnexpected JKQTPExpectedUnexpectedType()
60template<
class T,
class E>
69 throw std::runtime_error(
"value not available");
73 throw std::runtime_error(
"error not available");
an "expected" datatype, which can either represent a function result of type T or an error of type E
Definition jkqtpexpected.h:61
const E & error() const
Definition jkqtpexpected.h:71
const T m_value
Definition jkqtpexpected.h:79
const E m_error
Definition jkqtpexpected.h:80
const T & value() const
Definition jkqtpexpected.h:67
JKQTPExpected(const T &value_)
Definition jkqtpexpected.h:63
JKQTPExpected(JKQTPExpectedUnexpectedType, const E &error_)
Definition jkqtpexpected.h:65
const bool m_hasValue
Definition jkqtpexpected.h:78
bool has_value() const
Definition jkqtpexpected.h:75
JKQTPExpected(const JKQTPExpected< T, E > &other)=default