std::make_e...(std::errc)(3)
π NAME π
Okay so bestie, welcome to the std::make_error_condition(std::errc) page β page label std::make_e...(std::errc)(3), from the C++ Standard Libary manual. The NAME bit is std::make_error_condition(std::errc) β std::make_error_condition(std::errc). Yep, it says it twice, and honestly? Double the icon, double the slay. π
This is the iconic little function that makes an error condition out of an errc value. Yes queen, thatβs the whole assignment. β¨
β¨ Synopsis β¨
Defined in header <system_error>:
std::error_condition make_error_condition( std::errc e ) noexcept;
(since C++11)
What it does: creates an error condition for an errc value e. It sets the error value to int(e) and the error category to std::generic_category. Thatβs the whole plot, bestie. π
π Parameters π
eβ the standard error value. Thatβs it. Thatβs the parameter. π«Ά
πΈ Return value πΈ
An error condition for e. Boom. Slay. π
π¦ Example π¦
Run this code, bestie:
#include <iostream>
#include <string>
#include <system_error>
int main()
{
auto err = std::make_error_condition(std::errc::invalid_argument);
std::cout << err.message() << '\n';
}
β Possible output β
Invalid argument
Thatβs a wrap, bestie! Cute little sign-off: source http://cppreference.com, date/version 2024.06.10, and this page is std::make_e...(std::errc)(3). Mwah ππ
π¦ where this page comes from
- nixpkgs unstable: stdman 2024.07.05
- opensuse-leap 16.0: stdman 2024.07.05-bp160.1.9 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms