BDE 4.39.x Production Release
Loading...
Searching...
No Matches
bsl::error_code Class Reference

#include <bslstl_error.h>

Detailed Description

This class represents a system-specific error value.

See bslstl_error

Public Member Functions

 error_code ()
 
 error_code (int value, const error_category &category)
 
template<class ERROR_CODE_ENUM >
 error_code (ERROR_CODE_ENUM value, typename enable_if< is_error_code_enum< ERROR_CODE_ENUM >::value, BoolType >::type=0)
 
void assign (int value, const error_category &category)
 
template<class ERROR_CODE_ENUM >
enable_if< is_error_code_enum< ERROR_CODE_ENUM >::value, error_code & >::type operator= (ERROR_CODE_ENUM value)
 
void clear ()
 
const error_categorycategory () const
 
error_condition default_error_condition () const
 
std::string message () const
 
int value () const
 
 operator BoolType () const
 

Constructor & Destructor Documentation

◆ error_code() [1/3]

bsl::error_code::error_code ( )
inline

Create an object of this type initialized with value 0 and system category.

◆ error_code() [2/3]

bsl::error_code::error_code ( int  value,
const error_category category 
)
inline

Create an object of this type initialized with the specified value and category.

◆ error_code() [3/3]

template<class ERROR_CODE_ENUM >
bsl::error_code::error_code ( ERROR_CODE_ENUM  value,
typename enable_if< is_error_code_enum< ERROR_CODE_ENUM >::value, BoolType >::type  = 0 
)
inline

Construct an object of this type initialized with the specified value and its category (found from an overloaded call to make_error_code).

Note
Note that this constructor exists only for those types designated as error codes via the is_error_code_enum trait template.

Member Function Documentation

◆ assign()

void bsl::error_code::assign ( int  value,
const error_category category 
)
inline

Set this object to hold the specified value and category.

◆ category()

const error_category & bsl::error_code::category ( ) const
inline

Return a const reference to the category held by this object.

◆ clear()

void bsl::error_code::clear ( )
inline

Set this object to hold the value 0 and the system category.

◆ default_error_condition()

error_condition bsl::error_code::default_error_condition ( ) const
inline

Return an error_condition object initialized with the value and category of this object.

◆ message()

std::string bsl::error_code::message ( ) const
inline

Return a string describing this object.

◆ operator BoolType()

bsl::error_code::operator BoolType ( ) const
inline

Return whether the value held by this object is non-zero.

◆ operator=()

template<class ERROR_CODE_ENUM >
enable_if< is_error_code_enum< ERROR_CODE_ENUM >::value, error_code & >::type bsl::error_code::operator= ( ERROR_CODE_ENUM  value)
inline

Set this object to hold the specified value and its category (found from an overloaded call to make_error_code ).

Note
Note that this operator exists only for those types designated as error codes via the is_error_code_enum trait template.
Note that this object is set to the generic rather than system category, because that is what the standard specifies.

◆ value()

int bsl::error_code::value ( ) const
inline

Return the value held by this object.


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