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

std::io_errc - std::io_errc


Defined in header <ios>
enum class io_errc {


stream = 1, (since C++11)


};


The scoped enumeration std::io_errc defines the error codes reported by I/O streams
in std::ios_base::failure exception objects. Only one error code
(std::io_errc::stream) is required, although the implementation may define
additional error codes. Because the appropriate specialization of
std::is_error_code_enum is provided, values of type std::io_errc are implicitly
convertible to std::error_code.


Enumeration constant Value
stream 1


make_error_code(std::io_errc) constructs an iostream error code
(C++11) (function)
make_error_condition(std::io_errc) constructs an iostream error code
(C++11) (function)


is_error_code_enum<std::io_errc> extends the type trait std::is_error_code_enum to
(C++11) identify iostream error codes
(class template specialization)

// 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";
if(e.code() == std::io_errc::stream)
std::cout << "The error code is std::io_errc::stream\n";
}
}


Caught an ios_base::failure.
The error code is std::io_errc::stream


error_code holds a platform-dependent error code
(C++11) (class)
error_condition holds a portable error code
(C++11) (class)
failure stream exception
(public member class of std::ios_base)

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.