thrust::system::error_code

Defined in thrust/system/error_code.h

class error_code

The class error_code describes an object used to hold error code values, such as those originating from the operating system or other low-level application program interfaces.

Public Functions

inline error_code()

Effects: Constructs an object of type error_code.

Post

value() == 0 and category() == &system_category().

inline error_code(int val, const error_category &cat)

Effects: Constructs an object of type error_code.

Post

value() == val and category() == &cat.

template<typename ErrorCodeEnum>
error_code(ErrorCodeEnum e, ::cuda::std::enable_if_t<is_error_code_enum<ErrorCodeEnum>::value>* = 0)

Effects: Constructs an object of type error_code.

Post

*this == make_error_code(e).

inline void assign(int val, const error_category &cat)
Post

value() == val and category() == &cat.

template<typename ErrorCodeEnum>
::cuda::std::enable_if_t<is_error_code_enum<ErrorCodeEnum>::value, error_code> &operator=(ErrorCodeEnum e)
Post

*this == make_error_code(e).

inline void clear()
Post

value() == 0 and category() == system_category().

inline int value() const
Returns

An integral value of this error_code object.

inline const error_category &category() const
Returns

An error_category describing the category of this error_code object.

inline error_condition default_error_condition() const
Returns

category().default_error_condition().

inline std::string message() const
Returns

category().message(value()).

inline operator bool() const
Returns

value() != 0.