SPH
|
Wrapper of type containing either a value or an error message. More...
#include "objects/wrappers/Variant.h"
Go to the source code of this file.
Classes | |
struct | UnexpectedTag |
class | Expected< Type, Error > |
Wrapper of type that either contains a value of given type, or an error message. More... | |
Functions | |
template<typename T , typename = decltype(std::declval<std::ostream&>() << std::declval<T>())> | |
std::ostream & | operator<< (std::ostream &stream, const Expected< T > &expected) |
Prints the expected value into a stream. More... | |
template<typename Type > | |
Expected< Type > | makeUnexpected (const std::string &error) |
Constructs an unexpected value of given type, given error message as std::string. More... | |
Variables | |
const UnexpectedTag | UNEXPECTED |
Wrapper of type containing either a value or an error message.
Definition in file Expected.h.
Expected<Type> makeUnexpected | ( | const std::string & | error | ) |
Constructs an unexpected value of given type, given error message as std::string.
For other type of error messages, use constructor of Expected.
Definition at line 138 of file Expected.h.
|
inline |
Prints the expected value into a stream.
If the object contains an expected value, prints the value into the stream, otherwise print the error message. Enabled only if the wrapped type defines the operator<<, to that it corretly works with Catch framework.
Definition at line 125 of file Expected.h.
const UnexpectedTag UNEXPECTED |
Definition at line 14 of file Expected.h.