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, whileerror_code
values are implementation specific.Public Functions
-
inline error_condition()
Constructs an object of type
error_condition
.- Post
value() == 0
.- Post
-
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
istrue
.- 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 anerror_category
.- Parameters
val – The new value to return from
value()
.cat – The new
error_category
to return fromcategory()
.
- 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
istrue
.- Returns
*this
- Post
*this == make_error_condition(e)
.
-
inline void clear()
Clears this
error_code
object.- Post
value == 0
- Post
-
inline int value() const
- Returns
The value encoded by this
error_condition
.
-
inline const error_category &category() const
- Returns
A
const
reference to theerror_category
encoded by thiserror_condition
.
-
inline std::string message() const
- Returns
category().message(value())
.
-
inline error_condition()