AsmGrader 0.0.0
Loading...
Searching...
No Matches
error_types.hpp File Reference
#include <asmgrader/common/expected.hpp>
#include <boost/describe/enum.hpp>
#include <boost/preprocessor/cat.hpp>
Include dependency graph for error_types.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  asmgrader
 

Macros

#define TRYE_IMPL(val, e, ident)
 If the supplied argument is an error (unexpected) type, then propegate the error type e up the call stack. Otherwise, continue execution as normal.
 
#define TRY_IMPL(val, ident)
 
#define TRYE(val, e)
 
#define TRY(val)
 If the supplied argument is an error (unexpected) type, then propegate it up the call stack. Otherwise, continue execution as normal.
 

Typedefs

template<typename T >
using asmgrader::Result = Expected<T, ErrorKind>
 

Functions

 asmgrader::BOOST_DEFINE_ENUM_CLASS (ErrorKind, TimedOut, UnresolvedSymbol, UnexpectedReturn, UnknownError, SyscallFailure, MaxErrorNum)
 

Macro Definition Documentation

◆ TRY

#define TRY ( val)
Value:
TRY_IMPL(val, BOOST_PP_CAT(errrefe_uniq__, __COUNTER__))
#define TRY_IMPL(val, ident)
Definition error_types.hpp:39

If the supplied argument is an error (unexpected) type, then propegate it up the call stack. Otherwise, continue execution as normal.

◆ TRY_IMPL

#define TRY_IMPL ( val,
ident )
Value:
TRYE_IMPL(val, ident.error(), ident)
#define TRYE_IMPL(val, e, ident)
If the supplied argument is an error (unexpected) type, then propegate the error type e up the call s...
Definition error_types.hpp:29

◆ TRYE

#define TRYE ( val,
e )
Value:
TRYE_IMPL(val, e, BOOST_PP_CAT(errref_uniq__, __COUNTER__))

◆ TRYE_IMPL

#define TRYE_IMPL ( val,
e,
ident )
Value:
__extension__({ \
const auto& ident = val; \
if (!ident.has_value()) { \
using enum ErrorKind; \
return e; \
} \
ident.value(); \
})

If the supplied argument is an error (unexpected) type, then propegate the error type e up the call stack. Otherwise, continue execution as normal.