thrust::system::error_condition

Defined in thrust/system/error_code.h

class error_condition

The class error_condition describes an object used to hold values identifying error conditions.

Note

error_condition values are portable abstractions, while error_code values are implementation specific.

Public Functions

inline error_condition()

Constructs an object of type error_condition.

Post

value() == 0.

Post

category() == generic_category().

inline error_condition(int val, const error_category &cat)

Constructs an object of type error_condition.

Post

value() == val.

Post

category() == cat.

template<typename ErrorConditionEnum>
error_condition(ErrorConditionEnum e, ::cuda::std::enable_if_t<is_error_condition_enum<ErrorConditionEnum>::value>* = 0)

Constructs an object of type error_condition.

Note

This constructor shall not participate in overload resolution unless is_error_condition_enum<ErrorConditionEnum>::value is true.

Post

*this == make_error_condition(e).

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

Assigns to this error_code object from an error value and an error_category.

Parameters
Post

value() == val.

Post

category() == cat.

template<typename ErrorConditionEnum>
::cuda::std::enable_if_t<is_error_condition_enum<ErrorConditionEnum>::value, error_condition> &operator=(ErrorConditionEnum e)

Assigns to this error_code object from an error condition enumeration.

Note

This operator shall not participate in overload resolution unless is_error_condition_enum<ErrorConditionEnum>::value is true.

Returns

*this

Post

*this == make_error_condition(e).

inline void clear()

Clears this error_code object.

Post

value == 0

Post

category() == generic_category().

inline int value() const
Returns

The value encoded by this error_condition.

inline const error_category &category() const
Returns

A const reference to the error_category encoded by this error_condition.

inline std::string message() const
Returns

category().message(value()).

inline operator bool() const
Returns

value() != 0.