# std::error_code::clear

> C++ Atlas: `cppatlas.com/w/cpp/error/error_code/clear` | Source: https://en.cppreference.com/w/cpp/error/error_code/clear | Domain: Diagnostics | Standards: C++11

Replaces the error code and error category with default values.

## Official Specification Summary (cppreference)

```cpp
void clear() noexcept; // (since C++11)
```

Replaces the error code and error category with default values.

Equivalent to `*this = error_code(0, std::system_category())`.

### Parameters

(none)

### Return value

(none)

---
Attribution: content from https://en.cppreference.com/w/cpp/error/error_code/clear (cppreference.com), licensed under CC-BY-SA 3.0 and GFDL. Modified: converted to markdown, study notes added. Offline snapshot of 9 February 2025.