# std::make_error_code(std::errc)

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

Creates error code value for errc enum e.

## Official Specification Summary (cppreference)

```cpp
// Defined in header <system_error>
std::error_code make_error_code( std::errc e ) noexcept; // (since C++11)
```

Creates error code value for `errc` enum `e`.

Equivalent to `std::error_code(static_cast<int>(e), std::generic_category())`

### Parameters

- `e` - error code enum to create error code for

### Return value

Error code corresponding to `e`.

### See also

- [`make_error_code(std::io_errc)`](https://en.cppreference.com/w/cpp/io/io_errc/make_error_code) (C++11): constructs an iostream error code (function)
- [`make_error_code(std::future_errc)`](https://en.cppreference.com/w/cpp/thread/future_errc/make_error_code) (C++11): constructs a future error code (function)

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