LIEF: Library to Instrument Executable Formats Version 0.17.0
Loading...
Searching...
No Matches
LIEF::result< T > Class Template Reference

Wrapper that contains an Object (T) or an error. More...

#include <errors.hpp>

Inheritance diagram for LIEF::result< T >:
Collaboration diagram for LIEF::result< T >:

Detailed Description

template<typename T>
class LIEF::result< T >

Wrapper that contains an Object (T) or an error.

The tl/expected implementation exposes the method value() to access the underlying object (if no error)

Typical usage is:

result<int> intval = my_function();
if (intval) {
int val = intval.value();
} else { // There is an error
std::cout << get_error(intval).message() << "\n";
}
Wrapper that contains an Object (T) or an error.
Definition errors.hpp:75
lief_errors get_error(result< T > &err)
Get the error code associated with the result.
Definition errors.hpp:82

See https://tl.tartanllama.xyz/en/latest/api/expected.html for more details


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