[syserr.errcondition.modifiers]

# 19 Diagnostics library [[diagnostics]](./#diagnostics)

## 19.5 System error support [[syserr]](syserr#errcondition.modifiers)

### 19.5.5 Class error_condition [[syserr.errcondition]](syserr.errcondition#modifiers)

#### 19.5.5.3 Modifiers [syserr.errcondition.modifiers]

[ð](#lib:assign,error_condition)

`void assign(int val, const error_category& cat) noexcept;
`

[1](#1)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/diagnostics.tex#L1331)

*Postconditions*: *val_* == val and *cat_* == &cat[.](#1.sentence-1)

[ð](#lib:operator=,error_condition)

`template<class ErrorConditionEnum>
  error_condition& operator=(ErrorConditionEnum e) noexcept;
`

[2](#2)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/diagnostics.tex#L1343)

*Constraints*: is_error_condition_enum_v<ErrorConditionEnum> is true[.](#2.sentence-1)

[3](#3)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/diagnostics.tex#L1347)

*Effects*: Equivalent to:error_condition ec = make_error_condition(e);
assign(ec.value(), ec.category());

[4](#4)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/diagnostics.tex#L1355)

*Returns*: *this[.](#4.sentence-1)

[ð](#lib:clear,error_condition)

`void clear() noexcept;
`

[5](#5)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/diagnostics.tex#L1366)

*Postconditions*: value() == 0 and category() == generic_category()[.](#5.sentence-1)
