GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
std::system_error(3) C++ Standard Libary std::system_error(3)

std::system_error - std::system_error


Defined in header <system_error>
class system_error; (since C++11)


std::system_error is the type of the exception thrown by various library functions
(typically the functions that interface with the OS facilities, e.g. the constructor
of std::thread) when the exception has an associated std::error_code, which may be
reported.


std-system error-inheritance.svg


Inheritance diagram

Member functions


constructor constructs the system_error object
(public member function)
operator= replaces the system_error object
(public member function)
code returns error code
(public member function)
what returns an explanatory string
[virtual] (virtual public member function)

Inherited from std::exception

Member functions


destructor destroys the exception object
[virtual] (virtual public member function of std::exception)
what returns an explanatory string
[virtual] (virtual public member function of std::exception)

// Run this code


#include <thread>
#include <iostream>
#include <system_error>


int main()
{
try {
std::thread().detach(); // attempt to detach a non-thread
} catch(const std::system_error& e) {
std::cout << "Caught system_error with code " << e.code()
<< " meaning " << e.what() << '\n';
}
}


Caught system_error with code generic:22 meaning Invalid argument

2022.07.31 http://cppreference.com

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.