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::iostream_category(3) C++ Standard Libary std::iostream_category(3)

std::iostream_category - std::iostream_category


Defined in header <ios>
const std::error_category& iostream_category() noexcept; (since C++11)


Obtains a reference to the static error category object for iostream errors. The
object is required to override the virtual function error_category::name() to return
a pointer to the string "iostream". It is used to identify error codes provided in
the exceptions of type std::ios_base::failure.


(none)


A reference to the static object of unspecified runtime type, derived from
std::error_category.

// Run this code


#include <iostream>
#include <fstream>


int main()
{
std::ifstream f("doesn't exist");
try {
f.exceptions(f.failbit);
} catch (const std::ios_base::failure& e) {
std::cout << "Caught an ios_base::failure.\n"
<< "Error code: " << e.code().value()
<< " (" << e.code().message() << ")\n"
<< "Error category: " << e.code().category().name() << '\n';


}
}


Caught an ios_base::failure.
Error code: 1 (unspecified iostream_category error)
Error category: iostream


failure stream exception
(public member class of std::ios_base)
io_errc the IO stream error codes
(C++11) (enum)

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.